Re: [Haskell-cafe] Problem with haddock 2.3.0 (again)

2008-12-12 Thread Sean Leather
Call the original haddockHook with the updated flags rather than the haddock command. main = defaultMainWithHooks simpleUserHooks { haddockHook = \pkg lbi h f - let progs = userSpecifyArgs haddock [--optghc=-D__HADDOCK__] (withPrograms

Re: [Haskell-cafe] Problem with haddock 2.3.0 (again)

2008-12-12 Thread Sean Leather
I've been using cabal haddock to run haddock on my package. I also get the same error using haddock directly: $ haddock -odir=tmp --debug --verbose --html Generics/EMGM.hs haddock: internal Haddock or GHC error: Maybe.fromJust: Nothing Have you filed a ticket for this in the

Re: [Haskell-cafe] A curios monad

2008-12-12 Thread Martijn van Steenbergen
Andrew Coppin wrote: In other words, you can store a value (of arbitrary type) under a unique key. The monad chooses what key for you, and tells you the key so you can look up or alter the value again later. Under the covers, it uses Data.Map to store stuff. I used some trickery with

Re: [Haskell-cafe] Problem with haddock 2.3.0 (again)

2008-12-12 Thread Sean Leather
I've been using cabal haddock to run haddock on my package. I also get the same error using haddock directly: $ haddock -odir=tmp --debug --verbose --html Generics/EMGM.hs haddock: internal Haddock or GHC error: Maybe.fromJust: Nothing Have you filed a ticket for this in the

Re: [Haskell-cafe] Problem with haddock 2.3.0 (again)

2008-12-12 Thread Thomas Schilling
The fromJust error is a bug, of course, however, the underlying problem is a bit more difficult: Haddock doesn't generate any code, it only typechecks. If the code uses Template Haskell, however, the typechecker will have to run Haskell code and potentially this code will have to come from a

[Haskell-cafe] Re: Windows vs. Linux x64

2008-12-12 Thread Simon Marlow
John Meacham wrote: On Tue, Nov 25, 2008 at 09:39:35PM +0100, Ketil Malde wrote: This corresponds to my experiences - 64 bits is slower, something I've ascribed to the cost of increased pointer size. ghc unfortunatly also uses 64 bit integers when in 64 bit mode, so the cost paid is increased

[Haskell-cafe] Re: Data.Array.Storable vs GC

2008-12-12 Thread Simon Marlow
John Meacham wrote: GHC has 'pinned arrays' that have this behavior. however, you probably don't want to use them as they simply give the garbage collector less choices about what to do possibly decreasing its efficiency. The garbage collector already is free to not copy arrays if it feels it

Re: [Haskell-cafe] Problem with haddock 2.3.0 (again)

2008-12-12 Thread Sean Leather
On Fri, Dec 12, 2008 at 13:22, Thomas Schilling wrote: The fromJust error is a bug, of course, however, the underlying problem is a bit more difficult: Haddock doesn't generate any code, it only typechecks. If the code uses Template Haskell, however, the typechecker will have to run

Re: [Haskell-cafe] Memoization-question

2008-12-12 Thread Bertram Felgenhauer
Mattias Bengtsson wrote: The program below computes (f 27) almost instantly but if i replace the definition of (f n) below with (f n = f (n - 1) * f (n -1)) then it takes around 12s to terminate. I realize this is because the original version caches results and only has to calculate, for

Re: [Haskell-cafe] A curios monad

2008-12-12 Thread Ryan Ingram
On Fri, Dec 12, 2008 at 2:48 AM, Martijn van Steenbergen mart...@van.steenbergen.nl wrote: I've worried about this but I couldn't find a good code example of when this goes wrong. Can you? Without using any of the unsafeXxx functions, of course. Maybe I should build my monad on top of the ST

[Haskell-cafe] gtk2hs question - derive SettingsWindow from Window

2008-12-12 Thread Cetin Sert
Hi all, For a network manager of sorts I'm working on, I want to derive a SettingsWindowClass from the WindowClass present in Gtk2Hs: I want (the) instance(s) of the SettingsWindowClass to have a field to store connection settings: 1) Is it safe to do it like this? class WindowClass self ⇒

Re: [Haskell-cafe] A curios monad

2008-12-12 Thread Martijn van Steenbergen
Ryan Ingram wrote: Here's a simple example: runMud :: Mud a - a runMud = flip evalState emptyMud main = do let v = runMud (mkVar hello) let crash = runMud $ do v2 - mkVar True -- v2 :: Var Bool res - readVar v -- v :: Var String return res print crash --

[Haskell-cafe] Parsec and (then?) type-check

2008-12-12 Thread Greg Fitzgerald
Parser gurus, When you write a parser with a library like Parsec, do you typically type-check while parsing, or afterward in a separate pass? The latter is more modular, but it means labeling every element in the AST with the parser position so that you can give good error messages. Do you find

Re: [Haskell-cafe] Parsec and (then?) type-check

2008-12-12 Thread sam lee
I use my type checking monad, which is separate from Parsec's monad. So, I can't think of a way to type check during parsing in Parsec's monad. Anyways, this is what I did: data Expr = ... | At SourcePos Expr SourcePos is from Parsec. Basically, my parse actions will return (At pos e). And I

[Haskell-cafe] Numerics implementing different instances of the same class

2008-12-12 Thread George Pollard
Is there a good way of doing this? My running example is Monoid: class Monoid a where operation :: a - a - a identity :: a With the obvious examples on Num: instance (Num a) = Monoid a where operation = (+) identity = 1 instance (Num a) = Monoid a where

[Haskell-cafe] wlan library

2008-12-12 Thread Cetin Sert
Hi *^o^*, I am writing a network manager http://sert.homedns.org/hnm/ as a replacement for some broken, already existing knetworkmanager for a friend's computer. I was looking for some haskell libraries that provide access to wlan cards but could not find any on hackage. Maybe I missed

Re: [Haskell-cafe] wlan library

2008-12-12 Thread Don Stewart
cetin.sert: Hi *^o^*, I am writing [1]a network manager as a replacement for some broken, already existing knetworkmanager for a friend's computer. I was looking for some haskell libraries that provide access to wlan cards but could not find any on hackage. Maybe I missed

Re: [Haskell-cafe] Numerics implementing different instances of the same class

2008-12-12 Thread Dan Weston
What about something like data AddMult a b = AddMult a b class Monoid a where operation :: a - a - a identity :: a instance (Monoid a, Monoid b) = Monoid (AddMult a b) where operation (AddMult a1 m1) (AddMult a2 m2) = AddMult (operation a1 a2)

Re: [Haskell-cafe] Numerics implementing different instances of the same class

2008-12-12 Thread David Menendez
2008/12/12 George Pollard por...@porg.es: However, when it comes to defining (e.g.) a Field class you have two Abelian groups over the same type, which won't work straight off: Especially since you generally can't take the multiplicative inverse of the additive identity. I'm beginning to

[Haskell-cafe] ghc on CentOS 5 ?

2008-12-12 Thread Steve Lihn
I recently got a CentOS server, but noticed that ghc rpm is not available from CentOS yum. After investigation, I found ghc is in Fedora repository, but does not make its way to EPEL, which yum on CentOS can use. ( http://download.fedora.redhat.com/pub/epel/5/x86_64/) Is there any plan to get it

Re: [Haskell-cafe] ghc on CentOS 5 ?

2008-12-12 Thread Jeff Heard
I had luck building the latest GHC from source using the ghc 6.6 binary build to bootstrap. The 6.8+ binary builds run into a timer issue, at least on 64 bit CentOS that causes them to bork out during the configure script. 2008/12/12 Steve Lihn stevel...@gmail.com: I recently got a CentOS