Re: [Haskell-cafe] Difficulties installing LLVM bindings

2010-04-10 Thread Max Bolingbroke
On 10 April 2010 03:18, Aran Donohue aran.dono...@gmail.com wrote: problems with ghc-pkg.  I think we need to rebuild LLVM forcing 32-mode, but I haven't yet found the results of this. I'd love to hear what you did if you manage to get it going and compile programs. My LLVM checkout was still

Re: [Haskell-cafe] persist and retrieve of IO type?

2010-04-10 Thread Ivan Lazar Miljenovic
Daryoush Mehrtash dmehrt...@gmail.com writes: Is there a way to persist a [IO ()] to say a file then retrieve it later and execute it using a sequence function? I'm not sure I understand what you're wanting... you can pass around values of type IO () around, but they won't be executed until

Re: [Haskell-cafe] What is the consensus about -fwarn-unused-do-bind ?

2010-04-10 Thread Ivan Miljenovic
On 10 April 2010 00:20, Neil Brown nc...@kent.ac.uk wrote: The comments in that bug report actually mention My patch does not warn on uses of , only in do-notation, where the situation is more clear cut.  I take to be an explicit sign that the user wants to ignore the result of the first

Re: [Haskell-cafe] What is the consensus about -fwarn-unused-do-bind ?

2010-04-10 Thread Ivan Miljenovic
On 10 April 2010 02:07, Bryan O'Sullivan b...@serpentine.com wrote: Personally, I find it to be tremendously noisy and unhelpful, and I always edit my .cabal files to turn it off. I think of it as a usability regression. Yeah, I'm very tempted to do this as well. This warning might make sense

[Haskell-cafe] Re: persist and retrieve of IO type?

2010-04-10 Thread Jon Fairbairn
Ivan Lazar Miljenovic ivan.miljeno...@gmail.com writes: Daryoush Mehrtash dmehrt...@gmail.com writes: Is there a way to persist a [IO ()] to say a file then retrieve it later and execute it using a sequence function? I'm not sure I understand what you're wanting... you can pass around

[Haskell-cafe] Re: Hackage accounts and real names

2010-04-10 Thread Heinrich Apfelmus
Steve Schafer wrote: Heinrich Apfelmus wrote: I agree, and this is why I phased out apfelmus in favor of the pseudonym Heinrich Apfelmus. You mean your name isn't really Applesauce? I would probably apply for a name change if it were. ;) Regards, Heinrich Apfelmus --

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

2010-04-10 Thread Yves Parès
Thanks, I looked at the operational package (since it seemed simpler). I see its interest when building sets of operations. I think I see how I could apply it to my current problem. I saw in the tutorial the sentence: The ability to write multiple interpreters is also very useful for implementing

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

2010-04-10 Thread Yves Parès
I answered my own question by reading this monad-prompt example: http://paste.lisp.org/display/53766 But one issue remains: those examples show how to make play EITHER a human or an AI. I don't see how to make a human player and an AI play SEQUENTIALLY (to a TicTacToe, for instance). Yves

Re: [Haskell-cafe] Re: persist and retrieve of IO type?

2010-04-10 Thread Svein Ove Aas
On Sat, Apr 10, 2010 at 11:19 AM, Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote: It sounds more like he wants two functions something like save:: FilePath - [IO ()] - IO () restore:: FilePath - IO [IO ()] to which the answer would be no. It's an insoluble problem in general - the

[Haskell-cafe] Pictures from Tucson

2010-04-10 Thread Tom Hawkins
http://tomahawkins.org/Pictures/2010 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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

2010-04-10 Thread Philippa Cowderoy
On 10/04/2010 13:57, Yves Parès wrote: I answered my own question by reading this monad-prompt example: http://paste.lisp.org/display/53766 But one issue remains: those examples show how to make play EITHER a human or an AI. I don't see how to make a human player and an AI play SEQUENTIALLY (to

Re: [Haskell-cafe] Re: persist and retrieve of IO type?

2010-04-10 Thread Stephen Tetley
Hello all There has been Persistent Haskell - which was one of the Scottish tradition of persistent languages; being a sassenach myself I've no knowledge of whether it was actually implemented. Best wishes Stephen ___ Haskell-Cafe mailing list

[Haskell-cafe] Length of lists within list of lists?

2010-04-10 Thread boblettoj
Hi i want to know if there is any method i can use to count the number of items in each list in a list of lists, eg. someMethod [[a, b, c], [a], [b, d, e, f]] would return [3, 1, 4] is there anything that can do this? thanks -- View this message in context:

Re: [Haskell-cafe] Length of lists within list of lists?

2010-04-10 Thread aditya siram
You need a method that will find the length of a list: length :: [a] - Int and a method that will applies a function to every element of a list and make a list of the results: map :: (a -b) - [a] - [b] Try and put them together. hth, -deech On 4/10/10, boblettoj bobletto...@msn.com wrote:

Re: [Haskell-cafe] Length of lists within list of lists?

2010-04-10 Thread boblettoj
Ah yes of course, thankyou! boblettoj wrote: Hi i want to know if there is any method i can use to count the number of items in each list in a list of lists, eg. someMethod [[a, b, c], [a], [b, d, e, f]] would return [3, 1, 4] is there anything that can do this? thanks -- View

Re: [Haskell-cafe] Length of lists within list of lists?

2010-04-10 Thread Alexandru Scvortov
someMethod :: [[a]] - [Int] someMethod = map length There's a list, haskell-beginners better suited for this kind of question. Alex On Saturday 10 April 2010 18:02:37 boblettoj wrote: Hi i want to know if there is any method i can use to count the number of items in each list in a list of

[Haskell-cafe] unlifted types in classes

2010-04-10 Thread Phyx
Hi all, I was wondering if it's possible to have a class declaration that would except both unlifted types and lifted types as instances. For instance, I'm looking for something like class Foo a b where bar :: a - b instance Foo Int Int where bar = id instance Foo Int#

Re: [Haskell-cafe] Re: persist and retrieve of IO type?

2010-04-10 Thread Daryoush Mehrtash
Can you please explain this: the parameters baked into the thunk may be infinite daryoush On Sat, Apr 10, 2010 at 6:27 AM, Svein Ove Aas svein@aas.no wrote: On Sat, Apr 10, 2010 at 11:19 AM, Jon Fairbairn jon.fairba...@cl.cam.ac.uk wrote: It sounds more like he wants two

Re: [Haskell-cafe] Re: persist and retrieve of IO type?

2010-04-10 Thread Svein Ove Aas
On Sat, Apr 10, 2010 at 7:32 PM, Daryoush Mehrtash dmehrt...@gmail.com wrote: Can you please explain this: the parameters baked into the  thunk may be infinite I'm a bit bushed today, I think.. I was thinking of thunks. A haskell value can be infinite, since it's lazily evaluated;

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

2010-04-10 Thread Iavor Diatchki
Hello, It seems that rank-2 types are sufficient to make the more polymorphic types: {-# LANGUAGE Rank2Types #-} import Control.Exception data Mask = Mask (forall a. IO a - IO a) mask :: (Mask - IO a) - IO a mask io = do b - blocked if b

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

2010-04-10 Thread Iavor Diatchki
Hello, I wonder if it might be possible to use just one primitive which atomically changes the interrupt mask for a thread? Here is an example of what I'm thinking: data MaskingState = Unmasked | MaskedInterruptible | MaskedNonInterruptible -- Atomically

Re: [Haskell-cafe] Difficulties installing LLVM bindings

2010-04-10 Thread Aran Donohue
UNIVERSAL=1 worked for me too. Is there a way for cabal install to detect if LLVM wasn't built with this required flag and give a more informative error message? Aran On Sat, Apr 10, 2010 at 2:28 AM, Max Bolingbroke batterseapo...@hotmail.com wrote: On 10 April 2010 03:18, Aran Donohue

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

2010-04-10 Thread Yves Parès
Okay for IA, which doesn't need any special monad, but what if I want to make a network player ? It would have to run in a State monad, accessing to IO, storing a ByteString. For instance, (Monad m) = StateT ByteString m. The ByteString is a lazy one, we read from it to get the data sent by the

Re: [Haskell-cafe] haskell gsoc proposal for richer numerical type classes and supporting algorithms

2010-04-10 Thread Paul McJones
Dear Carter, Although I'm not an active Haskell programmer, I'd like to add my support for you to write up your GSOC application. In the first five chapters of the book /Elements of Programming/ (Addison-Wesley, 2009), my coauthor Alex Stepanov and I undertook a somewhat similar effort,