|
Bug in do expressions: msg#00027lang.haskell.glasgow.bugs
G'day all. In a recent GHC checkout, the following program: module Main(main) where import Maybe import Control.Monad test :: (MonadPlus m) => [a] -> m Bool test xs = do (_:_) <- return xs return True `mplus` do return False main :: IO () main = do let x = fromJust (test []) putStrLn (show x) causes a run-time exception: *** Exception: GhcBug.hs:9: Non-exhaustive patterns in 'do' expression Version 5.04 correctly prints "False". Cheers, Andrew Bromage
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: bug, Wolfgang Thaller |
|---|---|
| Next by Date: | RE: Bug in do expressions, Simon Peyton-Jones |
| Previous by Thread: | bug, John Meacham |
| Next by Thread: | RE: Bug in do expressions, Simon Peyton-Jones |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |