|
Re: The simplest program: msg#00043lang.haskell.glasgow.bugs
On Thu, Feb 13, 2003 at 03:41:13PM +0100, Wolfgang Thaller wrote: > The current HEAD is not able to compile the simplest of all Haskell > programs... but I don't think the bug affects anyone. > Compiling > > > module Main where > > main = return () > > yields > > Main.hs:1: > Ambiguous type variable `m' in these top-level constraint > `Monad m' arising from use of `return' at Main.hs:3 > Possible cause: the monomorphism restriction applied to the > following: > main :: m () (bound at Main.hs:3) > Probable fix: give these definition(s) an explicit type signature > > Giving the type signature helps, of course. The same program is > accepted by ghc-5.04.2. This bug is older! ghc 5.04 does not enforce that the return type of main is (). In fact with 5.04 you can return anything you want and get very fancy exception on termination if you return a more complex data type. I thought this is a way to directly return an error code, but saying main = return (5::Int) gives error code 0 when compiled and run with ghc 5.04. Axel.
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: Pattern matching with implicit par. bug, Simon Peyton-Jones |
|---|---|
| Next by Date: | [ ghc-Bugs-686546 ] panic! using ghci, SourceForge.net |
| Previous by Thread: | The simplest program, Wolfgang Thaller |
| Next by Thread: | Re: The simplest program, Wolfgang Thaller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |