[Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Magnus Therning
I'm trying to create a single cabal file containing specs for both a library and an executable using that library. I'm not having much luck though :( This is what I have so far: name: foo version: 0.1 exposed-modules: Foo.Bar other-modules: Foo.Qux Foo.C2HS hs-source-dirs: src

RE: [Haskell-cafe] FIT for Haskell

2007-05-01 Thread Bayley, Alistair
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philipp Volgger Who wrote FIT for Haskell on http://darcs.haskell.org/FIT/? Does anybody know if the version is stable? Hello Philipp, That would be me. It's not finished or stable, and I don't think it'll work with GHC-6.6

[Haskell-cafe] Re: 'Proper' use of the State monad

2007-05-01 Thread DavidA
1) Using State GameState r and then call execState for each game event (i.e. user input) so I can do IO 2) Using StateT GameState IO () and have the entire game live in one big execStateT call. (I note XMonad does something similar.) I'm also interested in the answer to this question. One

[Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Thomas Hartman
I was trying to follow the reasoning in Don's article on using haskell for shell scripting http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10 In the source listing at the end we is newtype Shell a = Shell { runShell :: ErrorT String IO a } deriving (Functor, Monad, MonadIO) and I

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Donald Bruce Stewart
tphyahoo: I was trying to follow the reasoning in Don's article on using haskell for shell scripting http://cgi.cse.unsw.edu.au/~dons/blog/2007/03/10 In the source listing at the end we is newtype Shell a = Shell { runShell :: ErrorT String IO a } deriving (Functor, Monad,

[Haskell-cafe] Re: Poor first impression

2007-05-01 Thread Simon Marlow
brad clawsie wrote: On Mon, Apr 30, 2007 at 09:53:06PM +0100, Andrew Coppin wrote: brad clawsie wrote: installing a modern linux on this box is a thirty minute exercise. Ah - a volunteer! :-) absolutely! for the low cost of one round-trip business-class seat from san jose to wherever this

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Thomas Hartman
Thanks Dons. There's also a short and sweet explanation here. http://hackage.haskell.org/trac/haskell-prime/wiki/NewtypeDeriving I am going to try and wrap my head around this, as I am very interested in solutions for haskell / shell interaction. Are there are any good examples of code

Re: [Haskell-cafe] Bloom Filter

2007-05-01 Thread Josef Svenningsson
Hi, Just a small comment on one of the comments. On 5/1/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Also, rather than this: add :: Bloom a - a - Bloom a a better argument order is this: insert :: a - Bloom a - Bloom a That way, you can use it with foldr. Hmmm. If you want to

Re: [Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Duncan Coutts
On Tue, 2007-05-01 at 09:34 +0100, Magnus Therning wrote: I'm trying to create a single cabal file containing specs for both a library and an executable using that library. I'm not having much luck though :( This is what I have so far: name: foo version: 0.1 exposed-modules:

Re: [Haskell-cafe] Re: 'Proper' use of the State monad

2007-05-01 Thread Sebastian Sylvan
On 5/1/07, DavidA [EMAIL PROTECTED] wrote: 1) Using State GameState r and then call execState for each game event (i.e. user input) so I can do IO 2) Using StateT GameState IO () and have the entire game live in one big execStateT call. (I note XMonad does something similar.) I'm also

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread Brandon S. Allbery KF8NH
On May 1, 2007, at 6:05 , Thomas Hartman wrote: Are there are any good examples of code written without this extension, alongside code condensed by using this extension. That would be helpful for understanding what's going on. I think all this does is save you from having to write a bunch of

Re: [Haskell-cafe] what exactly does deriving (Functor, Monad, MonadIO) do?

2007-05-01 Thread David House
On 01/05/07, Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: I think all this does is save you from having to write a bunch of wrappers that unwrap the contained value, do something to it, and rewrap the result. Exactly. Basically what newtype deriving does is if you have a declaration like

RE: [Haskell-cafe] Displaying infered type signature of 'offside' functions

2007-05-01 Thread Simon Peyton-Jones
| I like the strong static type system of Haskell for various | reasons. One reason is, that it makes easier to understand new | code. I.e. when I read code I type ':t foo' in ghci/hugs from | time to time, to check my own idea of the type signature, if it | is not included in the source code.

[Haskell-cafe] Re: Type-level programming problem

2007-05-01 Thread Thomas Schilling
On 1 maj 2007, at 06.12, [EMAIL PROTECTED] wrote: We see it is a value polymorphic over four type variables: ns, a, b, and c. The type variable 'a' is also the type of the value, so we have a way to instantiate it. There is no direct way to instantiate the remaining three. If there were a

[Haskell-cafe] Hugs/nhc getting progressively slower

2007-05-01 Thread Neil Mitchell
Hi, I like to develop on Hugs, because its a nice platform to work with, and provides WinHugs, auto-reloading, sub-second compilation etc. Unfortunately some of the newer libraries (ByteString/Binary in particular) have been optimised to within an inch of their lives on GHC, at the cost of being

[Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Philipp Volgger
Is Hs-Plugins still under develeopment; is there still somebody who is updating it? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Bloom Filter

2007-05-01 Thread Dom
Reminds me of this code from Data.Binary: unroll :: Integer - [Word8] unroll = unfoldr step where step 0 = Nothing step i = Just (fromIntegral i, i `shiftR` 8) roll :: [Word8] - Integer roll = foldr unstep 0 where unstep b a = a

Re: [Haskell-cafe] Hugs/nhc getting progressively slower

2007-05-01 Thread Duncan Coutts
On Tue, 2007-05-01 at 20:37 +0100, Neil Mitchell wrote: Hi, I like to develop on Hugs, because its a nice platform to work with, and provides WinHugs, auto-reloading, sub-second compilation etc. Unfortunately some of the newer libraries (ByteString/Binary in particular) have been optimised

Re: [Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Magnus Therning
On Tue, May 01, 2007 at 12:02:18 +0100, Duncan Coutts wrote: On Tue, 2007-05-01 at 09:34 +0100, Magnus Therning wrote: I'm trying to create a single cabal file containing specs for both a library and an executable using that library. I'm not having much luck though :( This is what I have so

Re: [Haskell-cafe] Re: 'Proper' use of the State monad

2007-05-01 Thread Yitzchak Gale
DavidA wrote: What I mean is, it seems like good design would mean that you could write and test the game logic totally independently of any IO. Game functions such as makeMove ought to have type signatures that don't involve any IO. Can this be achieved in option 2? Here is one way: For

Re: [Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Stefan O'Rear
On Tue, May 01, 2007 at 09:51:37PM +0200, Philipp Volgger wrote: Is Hs-Plugins still under develeopment; is there still somebody who is updating it? Not really. It works perfectly and fills its niche. Mature software is not under development! It is still maintained by Don Stewart. Stefan

Re: [Haskell-cafe] Cabal, lib and exe in one

2007-05-01 Thread Duncan Coutts
On Tue, 2007-05-01 at 22:29 +0100, Magnus Therning wrote: So if foo.hs is in test-src and Foo/Bar.hs is in src then I think you just need: hs-source-dirs: test-src, src No, that's not enough, I also have to add the following lines to make the executable compile and link: extensions:

Re: [Haskell-cafe] Bloom Filter

2007-05-01 Thread ajb
G'day all. Quoting Dom [EMAIL PROTECTED]: But better than what is in Codec.Utils: [deletia] It seems a shame that everyone has to roll their own. That and integer log base 2. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Bloom Filter

2007-05-01 Thread ajb
G'day all. I wrote: insert :: a - Bloom a - Bloom a That way, you can use it with foldr. Quoting Josef Svenningsson [EMAIL PROTECTED]: Hmmm. If you want to create a Bloom using a fold wouldn't it make more sense to use foldl'? I think the argument order is fine. You're right that

Re: [Haskell-cafe] Is Hs-Plugins dead?

2007-05-01 Thread Donald Bruce Stewart
pvolgger: Is Hs-Plugins still under develeopment; is there still somebody who is updating it? It's in stasis. It will likely get a little bit more updating when I finish my phd. It's needed for lambdabot in #haskell, so that's enough pressure to keep it working :-) For the longer term, a