Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Kevin Quick qu...@sparq.org writes: I need help understanding how to express the following: data (Cls a) = B a = B [a] I think this only works if you have a forall in there. data GrB a b = GrB (B a) instance Graph GrB where ... In the methods for the instance specification, I need

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Jason Dagit
On Fri, Apr 30, 2010 at 11:30 PM, Jason Dagit da...@codersbase.com wrote: On Fri, Apr 30, 2010 at 11:08 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: You're putting the constraint in the wrong places: put the (Cls a) = in the actual functions where you need it. That's

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Warren Harris
I thought I'd install happstack to give it a try, but immediately hit the following build problem: $ cabal install happstack Resolving dependencies... cabal: cannot configure HJScript-0.5.0. It requires hsx =0.7.0 For the dependency on hsx =0.7.0 there are these packages: hsx-0.7.0. However

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Brandon S. Allbery KF8NH
On May 1, 2010, at 02:38 , Jason Dagit wrote: Why wasn't the Graph class designed this way? My guess: It was probably a decision that predated multiparameter type classes. Or a specific decision was made to stick to Haskell'98 compatibility. -- brandon s. allbery

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Jason Dagit da...@codersbase.com writes: On Fri, Apr 30, 2010 at 11:08 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: You're putting the constraint in the wrong places: put the (Cls a) = in the actual functions where you need it. That's solid advice in general, but it's

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Jason Dagit da...@codersbase.com writes: On Fri, Apr 30, 2010 at 11:30 PM, Jason Dagit da...@codersbase.com wrote: Looking over this real quick, I think the Graph class should be changed to mention a and b: class Graph (gr a b) where ... Won't work: you need to specify that gr has kind * -

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Ivan Lazar Miljenovic
Warren Harris warrensomeb...@gmail.com writes: I thought I'd install happstack to give it a try, but immediately hit the following build problem: $ cabal install happstack Resolving dependencies... cabal: cannot configure HJScript-0.5.0. It requires hsx =0.7.0 For the dependency on hsx

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Brandon S. Allbery KF8NH allb...@ece.cmu.edu writes: On May 1, 2010, at 02:38 , Jason Dagit wrote: Why wasn't the Graph class designed this way? My guess: It was probably a decision that predated multiparameter type classes. Or a specific decision was made to stick to Haskell'98

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Miljenovic
Sorry for the useless noise, I realised just after I sent this that that is what Jason said initially :s On 1 May 2010 17:02, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Brandon S. Allbery KF8NH allb...@ece.cmu.edu writes: On May 1, 2010, at 02:38 , Jason Dagit wrote: Why wasn't

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Alexander Solla
On Apr 30, 2010, at 11:28 PM, Warren Harris wrote: $ cabal install happstack Resolving dependencies... cabal: cannot configure HJScript-0.5.0. It requires hsx =0.7.0 For the dependency on hsx =0.7.0 there are these packages: hsx-0.7.0. However none of them are available. hsx-0.7.0 was

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Jason Dagit
On Fri, Apr 30, 2010 at 11:53 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Jason Dagit da...@codersbase.com writes: On Fri, Apr 30, 2010 at 11:08 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: You're putting the constraint in the wrong places: put the (Cls

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Hmmm this is an interesting way of doing it, but I would argue that it's pointless: the fact that you're using MPTCs doesn't give you anything extra that the original class. Furthermore, as I said earlier, it doesn't make sense to constrain the label type just to make an instance of a type

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Jason Dagit
On Sat, May 1, 2010 at 12:23 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Hmmm this is an interesting way of doing it, but I would argue that it's pointless: the fact that you're using MPTCs doesn't give you anything extra that the original class. Furthermore, as I said

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Jason Dagit da...@codersbase.com writes: On Sat, May 1, 2010 at 12:23 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Hmmm this is an interesting way of doing it, but I would argue that it's pointless: the fact that you're using MPTCs doesn't give you anything extra that the

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Sebastian Fischer
Furthermore, as I said earlier, it doesn't make sense to constrain the label type just to make an instance of a type class. (Now, if we had other functions in there which _might_ depend on the label types, this _would_ make sense; as it stands however, it doesn't.) You'll notice that my

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Sebastian Fischer
On May 1, 2010, at 8:08 AM, Ivan Lazar Miljenovic wrote: * I can't redefine the Graph methods to introduce the (Cls a) constraint [reasonable] Not sure if you can. I think Kevin means that he cannot change the signature of the methods in the Graph class because those are defined in the

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Warren Harris
On May 1, 2010, at 12:08 AM, Alexander Solla wrote: I think that if you run this, you will satisfy all the dependencies: cabal install hjscript0.5.0 happstack Thank you. That worked. I had a similar problem installing the happstack-tutorial, but found that I could work around it with

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Sebastian Fischer s...@informatik.uni-kiel.de writes: Furthermore, as I said earlier, it doesn't make sense to constrain the label type just to make an instance of a type class. (Now, if we had other functions in there which _might_ depend on the label types, this _would_ make sense; as it

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Jason Dagit da...@codersbase.com writes: On Sat, May 1, 2010 at 12:49 AM, Ivan Lazar Miljenovic I thought we were discussing how expressive the Graph typeclass is, not whether I made a sensible implementation. I mean, I could pretty easily fix that problem, but I think that's not the

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Warren Harris
On May 1, 2010, at 1:28 AM, Ivan Lazar Miljenovic wrote: Warren Harris warrensomeb...@gmail.com writes: On May 1, 2010, at 12:08 AM, Alexander Solla wrote: I think that if you run this, you will satisfy all the dependencies: cabal install hjscript0.5.0 happstack Thank you. That worked.

[Haskell-cafe] Writing Mac OS X Plug-Ins in Haskell

2010-05-01 Thread Richard G.
Hello I'm trying to write self-contained Mac OS X plug-ins (http://developer.apple.com/mac/library/documentation/CoreFoundation/Conceptual/CFPlugIns/CFPlugIns.html) using GHC. I want the plug-in to be usable on a clean system (i.e., GHC and XCode are not installed). Does anyone have

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-01 Thread Johan Tibell
Hi Aran, On Fri, Apr 30, 2010 at 9:28 PM, Aran Donohue aran.dono...@gmail.comwrote: Thanks for the excellent links, that's exactly what I wanted. It's interesting that they've chosen not to base the new work on libevent. The reason was mostly performance concerns due to libev(ent) using

Re: [Haskell-cafe] Writing C libraries in Haskell

2010-05-01 Thread Bulat Ziganshin
Hello Richard, Saturday, May 1, 2010, 1:34:19 PM, you wrote: If libraries foo and bar are compiled using the same version of GHC, is is possible to link the two libraries into the same executable? Does at the last end, you can put each entire library plus ghc runtime into dll -- Best

[Haskell-cafe] Happy: PATH issue

2010-05-01 Thread Limestraël
Hello Café, When I was trying to cabal-install haskell-src, I came up with: cabal: The program happy is required but it could not be found However, the happy package was actually installed and the 'happy' executable was in ~/.cabal/bin (which was in my PATH) I had to link ~/.cabal/bin/happy to

Re: [Haskell-cafe] Happy: PATH issue

2010-05-01 Thread Daniel Fischer
Am Samstag 01 Mai 2010 13:16:55 schrieb Limestraël: Hello Café, When I was trying to cabal-install haskell-src, I came up with: cabal: The program happy is required but it could not be found However, the happy package was actually installed and the 'happy' executable was in ~/.cabal/bin

[Haskell-cafe] Re: Fwd: Re: Simple game: a monad for each player

2010-05-01 Thread Heinrich Apfelmus
Limestraël wrote: Heinrich, I saw you updated your operational package (you considered my remark about ProgramView, thank you) Your feedback is much appreciated. :) I saw you added a liftProgram function, however it is not like the mapMonad function you were talking about. mapMonad was:

[Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Roly Perera
Hi, I've just upgraded from 6.10.1 to 6.12.1 and can't seem to find all the library documentation. This page is apparently the documentation root: http://www.haskell.org/ghc/docs/6.12.1/html/ but if I click through to the Haskell Hierarchical Libraries page

Re: [Haskell-cafe] profiling uniplate

2010-05-01 Thread Sebastian Fischer
I guess I either need to install profiling libraries for uniplate, or disable profiling of those functions coming from uniplate. Exactly. For the former cabal install --reinstall --enable-library-profiling uniplate should do the trick. Sebastian -- Underestimating the novelty of the

Re: [Haskell-cafe] profiling uniplate

2010-05-01 Thread Johan Tibell
On Sat, May 1, 2010 at 3:02 PM, Sebastian Fischer s...@informatik.uni-kiel.de wrote: I guess I either need to install profiling libraries for uniplate, or disable profiling of those functions coming from uniplate. Exactly. For the former cabal install --reinstall

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread David Leimbach
Those libraries are not distributed with the compiler. Use either The Haskell Platform, or hackage to get those packages. On Saturday, May 1, 2010, Roly Perera roly.per...@dynamicaspects.org wrote: Hi, I've just upgraded from 6.10.1 to 6.12.1 and can't seem to find all the library

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Jeremy Shaw
Hello, I would recommend: darcs get --lazy http://patch-tag.com/r/mae/happstack cd happstack chmod +x bin/build-install-all.sh ./bin/build-install-all.sh This should install the latest version of happstack from darcs which resolves most install problems. I intend to release it any minute

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Ben Millwood
On Sat, May 1, 2010 at 1:41 PM, Roly Perera roly.per...@dynamicaspects.org wrote: I can't for example find Control.Monad.State. I guess I'm missing something obvious about how things are organised? The following places might therefore be of interest: http://hackage.haskell.org/package/mtl

Re: [Haskell-cafe] profiling uniplate

2010-05-01 Thread Ozgur Akgun
Thanks guys! On 1 May 2010 14:04, Johan Tibell johan.tib...@gmail.com wrote: On Sat, May 1, 2010 at 3:02 PM, Sebastian Fischer s...@informatik.uni-kiel.de wrote: I guess I either need to install profiling libraries for uniplate, or disable profiling of those functions coming from

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Ivan Lazar Miljenovic
Roly Perera roly.per...@dynamicaspects.org writes: I've just upgraded from 6.10.1 to 6.12.1 and can't seem to find all the library documentation. This page is apparently the documentation root: http://www.haskell.org/ghc/docs/6.12.1/html/ but if I click through to the Haskell Hierarchical

[Haskell-cafe] Typing Haskell in Haskell

2010-05-01 Thread Aaron Gray
Hi, I am relatively new to Haskell. I am attempting to get Typing Haskell in Haskell to work on HUGS or GHC. http://web.cecs.pdx.edu/~mpj/thih/ I am getting an error on loading SourcePrelude :- Hugs :l SourcePrelude ERROR .\PPrint.hs - Can't find imported module Pretty And I cannot

Re: [Haskell-cafe] Typing Haskell in Haskell

2010-05-01 Thread Gwern Branwen
On Sat, May 1, 2010 at 10:05 AM, Aaron Gray aaronngray.li...@googlemail.com wrote: Hi, I am relatively new to Haskell. I am attempting to get Typing Haskell in Haskell to work on HUGS or GHC.    http://web.cecs.pdx.edu/~mpj/thih/ I am getting an error on loading SourcePrelude :-    Hugs :l

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Roly Perera
Thanks for those replies, it's a lot clearer now. By the way, is there a unified package view for all the documentation shipped with the Haskell Platform, or do I need to know what library to look in? cheers, Roly On 1 May 2010 15:33, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Roly

Re: [Haskell-cafe] Typing Haskell in Haskell

2010-05-01 Thread Ivan Lazar Miljenovic
Aaron Gray aaronngray.li...@googlemail.com writes: I am relatively new to Haskell. I am attempting to get Typing Haskell in Haskell to work on HUGS or GHC. http://web.cecs.pdx.edu/~mpj/thih/ I am getting an error on loading SourcePrelude :- Hugs :l SourcePrelude ERROR

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Ivan Lazar Miljenovic
Roly Perera roly.per...@dynamicaspects.org writes: Thanks for those replies, it's a lot clearer now. By the way, is there a unified package view for all the documentation shipped with the Haskell Platform, or do I need to know what library to look in? You need to know which library they're

Re: [Haskell-cafe] Re: Asynchronous exception wormholes kill modularity

2010-05-01 Thread Bas van Dijk
I created a ticket about the asynchronous exception wormholes so that we won't forget about them: http://hackage.haskell.org/trac/ghc/ticket/4035 regards, Bas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Location of library documentation with 6.12.1?

2010-05-01 Thread Ben Millwood
On Sat, May 1, 2010 at 3:33 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: You need to know which library they're in. You can use the ghc-pkg tool to do this: $ ghc-pkg find-module Control.Monad.State /usr/lib/ghc-6.12.1/package.conf.d monads-fd-0.0.0.1 mtl-1.1.0.2

[Haskell-cafe] Re: Functional Dependencies Help

2010-05-01 Thread John Creighton
On Apr 30, 6:18 pm, John Creighton johns2...@gmail.com wrote: On Apr 29, 7:47 am, John Creighton johns2...@gmail.com wrote: I've been trying to apply some stuff I learned about functional dependencies, but I run into one of two problems. I either end up with inconsistent dependencies

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-01 Thread Gregory Collins
Johan Tibell johan.tib...@gmail.com writes: Hi Aran, On Fri, Apr 30, 2010 at 9:28 PM, Aran Donohue aran.dono...@gmail.com wrote: Thanks for the excellent links, that's exactly what I wanted. It's interesting that they've chosen not to base the new work on libevent.  The

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Warren Harris
On May 1, 2010, at 3:39 AM, Daniel Fischer wrote: Try $ cabal install --constraint=Crypto4.2.1 -- constraint=HJScript0.5 happs-tutorial This had the same problem building containers: Building containers-0.2.0.1... Data/IntMap.hs:182:7: Could not find module `Data.Data': It is

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Daniel Fischer
Am Samstag 01 Mai 2010 19:06:33 schrieb Warren Harris: On May 1, 2010, at 3:39 AM, Daniel Fischer wrote: Try $ cabal install --constraint=Crypto4.2.1 -- constraint=HJScript0.5 happs-tutorial This had the same problem building containers: Building containers-0.2.0.1...

Re: [Haskell-cafe] Re: Asynchronous exception wormholes kill modularity

2010-05-01 Thread Simon Marlow
On 01/05/10 16:17, Bas van Dijk wrote: I created a ticket about the asynchronous exception wormholes so that we won't forget about them: http://hackage.haskell.org/trac/ghc/ticket/4035 Thanks - don't worry, I haven't forgotten, just been busy with other things. Cheers, Simon

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Kevin Quick
On Fri, 30 Apr 2010 23:30:21 -0700, Jason Dagit da...@codersbase.com wrote: On Fri, Apr 30, 2010 at 11:08 PM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: You're putting the constraint in the wrong places: put the (Cls a) = in the actual functions where you need it. I need to

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Kevin Quick
On Sat, 01 May 2010 01:01:47 -0700, Sebastian Fischer s...@informatik.uni-kiel.de wrote: On May 1, 2010, at 8:08 AM, Ivan Lazar Miljenovic wrote: * I can't redefine the Graph methods to introduce the (Cls a) constraint [reasonable] Not sure if you can. I think Kevin means that he cannot

[Haskell-cafe] IO (Either a Error) question

2010-05-01 Thread Eugeny N Dzhurinsky
Hello! I have some sort of strange question: assume that there are 2 functions func1 :: Int - IO (Either Error String) func2 :: String - IO (Either Error [String]) in case if there will be no IO involved, I could use Control.Monad.Either and write something like runCalc :: Int - IO (Either

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-01 Thread Ryan Ingram
Check out ErrorT in Control.Monad.Error :t ErrorT ErrorT :: m (Either e a) - ErrorT e m a :info ErrorT instance (Monad m, Error e) = Monad (ErrorT e m) :info Error class Error e where noMsg :: e strMsg :: String - e So, if you can make your Error type an instance of this class, you

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-01 Thread John Millikin
You might want to make a local version of ErrorT in your library, to avoid the silly 'Error' class restriction. This is pretty easy; just copy it from the 'transformers' or 'mtl' package. On Sat, May 1, 2010 at 14:42, Ryan Ingram ryani.s...@gmail.com wrote: Check out ErrorT in

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-01 Thread Miguel Mitrofanov
It's called monad transformers func1' :: Int - EitherT Error IO String func1' n = EitherT $ func1 n func2' :: Int - EitherT Error IO String func2' s = EitherT $ func2 n runCalc' :: Int - EitherT Error IO [String] runCalc' param = func1' param = func2' runCalc :: Int - IO (Either Error [String])

[Haskell-cafe] MonadPlus or Alternative or ...?

2010-05-01 Thread Sean Leather
I want to generalize a set of functions from lists to some functor type. I require the following three operation types. f a a - f a f a - f a - f a Should I choose MonadPlus and use these? mzero return mplus Or should I choose Alternative and use these? empty pure (|) Or

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Kevin Quick
On Sat, 01 May 2010 15:42:09 -0700, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: instance Graph GrB where -- instance (Cls a) = Graph GrB where -- error: ambiguous constraint, must mention type a -- instance (Cls a) = forall a. Graph GrB where -- error: malformed instance header --

Re: [Haskell-cafe] MonadPlus or Alternative or ...?

2010-05-01 Thread Mark Wassell
Check the laws that instances of MonadPlus and Alternative should comply with to help you make your decision. Cheers Mark Sean Leather wrote: I want to generalize a set of functions from lists to some functor type. I require the following three operation types. f a a - f a f a - f a

[Haskell-cafe] GTKHS mailing list:

2010-05-01 Thread John Creighton
Something needs to be done about the GTKhs mailing list. It is flooded with spam that no one would want coming to their in box: http://haskell.org/pipermail/gtkhs/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Benchmarks game updated to ghc 6.12.2

2010-05-01 Thread Jason Dusek
2010/04/30 Don Stewart d...@galois.com: Prior to the upgrade we weren't mostly beaten on speed, so I think a bit of tuning (ghc -server :) should help. What do you mean by that? I tried searching the flags page: http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/flag-reference.html

Re: [Haskell-cafe] Benchmarks game updated to ghc 6.12.2

2010-05-01 Thread Don Stewart
jason.dusek: 2010/04/30 Don Stewart d...@galois.com: Prior to the upgrade we weren't mostly beaten on speed, so I think a bit of tuning (ghc -server :) should help. What do you mean by that? I tried searching the flags page:

Re: [Haskell-cafe] Build problems (hsp, trhsx, ultimately Happstack)

2010-05-01 Thread Alexander Solla
On May 1, 2010, at 10:54 AM, Warren Harris wrote: I think I'll have to wait for Jeremy's update. On the plus side, the comments/source in the tutorial are pretty good to follow the source along as an example, even if you don't compile and run them. I didn't bother installing

Re: [Haskell-cafe] FGL instance constraint

2010-05-01 Thread Ivan Lazar Miljenovic
Kevin Quick qu...@sparq.org writes: I was trying to put them on the inside. Essentially I was trying to use the 'a' portion of the LNode as a type that would provide methods from which I could reconstruct the shape of the Graph. Or to put it another way, I had a collection of data and I

Re: [Haskell-cafe] are forkIO threads event-driven?

2010-05-01 Thread Donn Cave
In GHC, if a thread spawned by forkIO blocks on some network or disk IO, is the threading system smart enough not to wake the thread ... disk IO, you say? Most platforms support asynchronous I/O for what UNIX calls `slow' devices - pipe, tty, Berkeley socket. Select, poll, kqueue, O_NDELAY,