[Haskell-cafe] Finding substantial examples of Cabal Setup files

2009-12-10 Thread Jon Strait

Hi all,

I was looking through some of the Hackage packages to find examples of 
how developers are extending UserHooks in their Setup files, but it 
wasn't easy, since the great majority of Cabal Setup files in Hackage 
simply require only the standard line of  'main = defaultMain' or 
'defaultMainWithHooks' with a standard UserHooks value.


So, I started hacking together a little Emacs Lisp script to walk 
through all the packages in the Hackage archive and report on the Setup 
files that looked interesting enough to serve as non-trivial examples.  
Here is the latest result:


http://www.moonloop.net/haskell/docs/cbs-custom.html


Jon

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Confusion on the third monad law when using lambda abstractions

2009-06-17 Thread Jon Strait

Hi everyone,

I use and love Haskell, but I just have this nagging concern, that maybe 
someone can help me reason about.  If I'm missing something completely 
obvious here and making the wrong assumptions, please be gentle.  :)


I'm reading the third (bind associativity) law for monads in this form:

m >>= (\x -> k x >>= h)  =  (m >>= k) >>= h

Now considering the definition of liftM2:

liftM2 f m1 m2 = m1 >>= (\x1 -> m2 >>= (\x2 -> return (f x1 x2)))

Isn't this liftM2  definition in the same form as the LHS of the third 
law equation, with (\x2 -> return (f x1 x2)) being the h function?  
Comparing this definition with the third law equation, the equation 
doesn't work because on the RHS equivalent; the x1 argument would be lost.


So, why wasn't I finding a mention of a qualification that states that 
the third law only applies as long as the function in the h position 
doesn't reference arguments bound from previous 'binds'?


It took going all the way back to Philip Wadler's 1992 paper, 'Monads 
for functional programming' to find reassurance:


"The scope of variable x includes h on the left but excludes h on the 
right, so this law is valid only when x does not appear free in h."


I'm also thinking of the Maybe monad, where

Nothing >>= \x -> Just (x + 1) >>= \y -> return (y + 2)

evaluates to Nothing after the first monadic bind and doesn't evaluate 
the rest of the expression.


However,

Nothing >>= Just . (+ 1) >>= return . (+ 2)

should evaluate through the first and second monadic bind, evaluating to 
Nothing each time, of course.


For the Maybe monad, both expressions give the same result, but if there 
were another monad defined like,


data MadMaybe a = Nothing | Perhaps | Just a

instance Monad MadMaybe where
   (Just x) >>= k = k x
   Nothing >>= _ = Perhaps
   Perhaps >>= _ = Nothing

- then the two previous expressions run in the MadMaybe monad would 
evaluate to different values.  Since the first of the previous 
expressions evaluates like the LHS of the third law equation above and 
the second expression evaluates like the RHS, the expressions should be 
equivalent, but they are not.  Does this put into question the third 
monad law's relevance to Haskell monads, or is it that MadMaybe 
shouldn't be made a monad because it violates the third law?


Thanks for any insight.

Jon
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: ANN: Yi 0.4.1

2008-07-30 Thread Jon Strait
I had the same problem on x86_64 linux using the Gtk front and no custom 
config with the current Yi on Hackage (0.4.3).  Using catchGError revealed:


user error (Failed to open file 
'/home/bernardy/.cabal/share/yi-0.4.3/art/yi+lambda-fat.32.png': No such 
file or directory)


Tracked down to Paths_yi.hs :

bindir = "/home/bernardy/.cabal/bin"
libdir = "/home/bernardy/.cabal/lib/yi-0.4.3/ghc-6.8.3"
datadir= "/home/bernardy/.cabal/share/yi-0.4.3"
libexecdir = "/home/bernardy/.cabal/libexec"

I just built the latest Yi from Darcs and this seems to have been fixed.

- Jon




Duncan Coutts wrote:

On Sun, 2008-07-27 at 20:58 +, Jean-Philippe Bernardy wrote:
  

Don Stewart  galois.com> writes:




$ yi -f pango
Launching custom yi: "/home/dons/.yi/yi-x86_64-linux"
yi: exception :: System.Glib.GError.GError

Anyone seen this?
  

Consistently on x64. The pango stuff is generally unstable anyway. I'm not sure
what's to blame.



That's interesting. That's a Haskell exception (dynamic type). I doubt
it's being thrown by the Pango code, there's only one use of it there,
in parseMarkup and that should throw parsing errors pretty much
independent of platform.

You can catch those GError exceptions and print more interesting info.
Use:

  

catchGError
  (do ...
  ...)
  (\(GError dom code msg) -> fail msg)




Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
  


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: Launching Haskell Group in Vancouver, Canada

2008-07-14 Thread Jon Strait
For those in Vancouver, a short announcement about the recently created 
Haskell Programmers Group and a meeting scheduled for next Monday, July 
21st.


http://groups.google.com/group/hugvan

Future group announcements will be posted on this Google Groups site, so 
feel free to join the group list to be notified of future events or just 
show up to a meeting to bounce ideas and questions off of other Haskell 
programmers.


Thanks,
Jon


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Vancouver Haskell users meeting

2008-06-07 Thread Jon Strait

I'll try to keep this going.  I think it's a good idea.

See you in the fall!

Jon

Asumu Takikawa wrote:

Hi. I'd be interested in a meeting like this, but unfortunately since
UBC is done for winter term I'm out of Canada for the summer. If anyone
organizes a meet-up come fall I'd happily attend. 


Cheers,
AT

On 12:48 Mon 02 Jun , Jon Strait wrote:
  

   Anyone else here from Vancouver (Canada)?  I thought it would be great
   to have a little informal get-together at a local cafe and share how
   we're currently using Haskell, or really anything (problems,
   comparisons, useful software tools, etc.) in relation to Haskell.
   I'm scheduling a meeting for this Thursday, June 5th. for 7PM at
   [1]Waazubee Cafe.  (At Commercial Dr. and 1st Ave.)
   They have wireless internet access.  I'll get a table near the back,
   bring my laptop, and will have a copy of Hudak's SOE book (the front
   cover is impossible to miss) out on the table.
   If anyone wants to meet, but this Thursday is not a good day for you,
   let me know what days are better and we'll move the meeting.  If anyone
   is sure that they will come this Thursday, you might let me know, so I
   can have an idea about the resistance in changing the day, if needed.
   Thanks,
   Jon

References

   1. http://www.waazubee.com/content/directions.php



  

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe



  


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Vancouver Haskell users meeting

2008-06-02 Thread Jon Strait
Anyone else here from Vancouver (Canada)?  I thought it would be great 
to have a little informal get-together at a local cafe and share how 
we're currently using Haskell, or really anything (problems,  
comparisons, useful software tools, etc.) in relation to Haskell.


I'm scheduling a meeting for this Thursday, June 5th. for 7PM at 
 Waazubee Cafe - 
http://www.waazubee.com/content/directions.php  (at Commercial Dr. and 
1st Ave.) 

They have wireless internet access.  I'll get a table near the back, 
bring my laptop, and will have a copy of Hudak's SOE book (the front 
cover is impossible to miss) out on the table.


If anyone wants to meet, but this Thursday is not a good day for you, 
let me know what days are better and we'll move the meeting.  If anyone 
is sure that they will come this Thursday, you might let me know, so I 
can have an idea about the resistance in changing the day, if needed.


Thanks,

Jon
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Vancouver Haskell users meeting

2008-06-02 Thread Jon Strait




Anyone else here from Vancouver (Canada)?  I thought it would be great
to have a little informal get-together at a local cafe and share how
we're currently using Haskell, or really anything (problems, 
comparisons, useful software tools, etc.) in relation to Haskell. 

I'm scheduling a meeting for this Thursday, June 5th. for 7PM at Waazubee Cafe. 
(At Commercial Dr. and 1st Ave.)  

They have wireless internet access.  I'll get a table near the back,
bring my laptop, and will have a copy of Hudak's SOE book (the front
cover is impossible to miss) out on the table. 

If anyone wants to meet, but this Thursday is not a good day for you,
let me know what days are better and we'll move the meeting.  If anyone
is sure that they will come this Thursday, you might let me know, so I
can have an idea about the resistance in changing the day, if needed.

Thanks,

Jon



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Build dependency problem with bytestring.

2008-03-07 Thread Jon Strait

Don Stewart wrote:

jstrait:
  

Hi all,

I'm upgrading HAppS from my 0.9.2 to the current 0.9.2.1 in Hackage.  
Some HAppS components have built and installed (IxSet and Util).  
Halfway through the HAppS-State build, the GHC runtime linker gives a 
fatal error on finding a duplicate definition for symbol fps_minimum 
while loading bytestring 0.9.0.4 after having already loaded bytestring 
0.9.0.1.  From trial and error, I'm guessing that HAppS-State needs 
0.9.0.1 but one of its build dependencies was built with 0.9.0.4.   
Using GHC 6.8.2 Linux here.


Any suggestions on how best to currently approach this situation?
.



you need to uninstall your happs build, uninstall bytestring 0.9.0.1,
and start over, so all packages link against 0.9.0.4 only.

Cheers,
  Don
  
Thanks for the response, Don.  I ended up unregistering and rebuilding 
many more packages against bytestring 0.9.0.4 that had previously been 
built against 0.9.0.1.  However, GHC itself had been built with 
bytestring 0.9.0.1, and was showing up as broken in the package 
listing.  So, when I was done fighting the missing dependency errors, I 
just reinstalled bytestring 0.9.0.1 and let the rest be, for now.


Another issue I had, and I don't think this is the intended behavior of 
Cabal, is that when using 'cabal install --global' as root, lib files 
from the package would be placed under the root's own .cabal/lib/ 
directory.  So, as a different user, I would be unable to access those 
lib files if they were needed for my own local build.  I had to add the 
option
'--libdir=/usr/lib/ghc-6.8.2/lib' on install, something I thought 
should have been implicit when using the --global option.



Jon
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Build dependency problem with bytestring.

2008-03-06 Thread Jon Strait

Hi all,

I'm upgrading HAppS from my 0.9.2 to the current 0.9.2.1 in Hackage.  
Some HAppS components have built and installed (IxSet and Util).  
Halfway through the HAppS-State build, the GHC runtime linker gives a 
fatal error on finding a duplicate definition for symbol fps_minimum 
while loading bytestring 0.9.0.4 after having already loaded bytestring 
0.9.0.1.  From trial and error, I'm guessing that HAppS-State needs 
0.9.0.1 but one of its build dependencies was built with 0.9.0.4.   
Using GHC 6.8.2 Linux here.


Any suggestions on how best to currently approach this situation?

Thanks,
Jon


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe