A couple of bugs



About this list Date view Thread view Subject view Author view

Wojciech Moczydlowski, Jr (khaliff@astercity.net)
Wed, 2 Aug 2000 18:01:46 +0200 (CEST)


Here's the module: module MonadState where class (Monad m) => MonadState s m where get :: m s put :: s -> m () And here's the compiler message: [khaliff@localhost nhc]$ nhc98 -c MonadState.hs In file ./MonadState.hs: -} but expected a {-EOF-} Not very helpful - in fact I find it impossible to understand. Guess it's a parser problem. The second problem: module Main where {-# -} main = return () [khaliff@localhost khaliff]$ nhc98 1.hs In file ./1.hs: 3:1 Found {-# but expected a {-EOF-} According to Haskell report, {-# is a legal comment. The third one - parser generated by happy fails with "Internal happy error". I'd rather not include the whole parser with this letter - the file size is 120KB. The fourth one: Two modules: File: 1.hs module Main where import A f :: Either Int Int f = do Left 5 Right 5 -------------------------------------------------- File: A.hs module A where instance Monad (Either a) where return v = Right v p >>= f = case p of Left a -> Left a Right a -> f a -------------------------------------------------- [khaliff@localhost khaliff]$ nhc98 1.hs A.hs Fail: The class Prelude.Monad has no instance for the type Prelude.Either. Possible sources for the problem are:7:9 Wojciech Moczydlowski, Jr


About this list Date view Thread view Subject view Author view