Bug in HLint or haskell-src-exts?

Hello Haskellers, I've got the following piece of code type Memory addr value = Map.Map addr value type Stack item = [item] data MachineState addr value item = MachineState { memory :: Memory addr value , stack :: Stack item } deriving (Show) newtype Machine addr value item m a = Machine { unMachine :: StateT (MachineState addr value item) m a } deriving (Monad, MonadState (MachineState addr value item), MonadTrans, MonadIO) and HLint complains: Machine.hs:20:31: Parse failure, Parse error This is exactly the position of the opening bracket after MonadState. Why can GHC parse this and HLint cannot? Regards, Martin.

Hello again, I found another problem I dont understand: evalOp :: Op -> (Integer -> Integer -> Integer) evalOp op = case op of Plus -> (+) Minus -> \x y -> max 0 (x-y) Times -> (*) brings a parse error, too: Interpreter.hs:92:3: Parse failure, Parse error in expression: DVar [Ident "x",Ident "... The mentioned position is the "T" of "Times" in the last line. Regards, Martin.

Hi Martin,
both of your problems are due to known deficiencies in
haskell-src-exts, and I'm working on solving them. The first comes
from its subpar handling of newtype deriving for MPTCs, the second
from a weird case where you (currently) need spaces around -, i.e. in
your example write (x - y) and HLint/haskell-src-exts will accept it.
Thanks for reporting,
/Niklas
ps. I really ought to get myself a bug tracker...
On Thu, Feb 26, 2009 at 10:49 PM, Martin Huschenbett
Hello again,
I found another problem I dont understand:
evalOp :: Op -> (Integer -> Integer -> Integer) evalOp op = case op of Plus -> (+) Minus -> \x y -> max 0 (x-y) Times -> (*)
brings a parse error, too:
Interpreter.hs:92:3: Parse failure, Parse error in expression: DVar [Ident "x",Ident "...
The mentioned position is the "T" of "Times" in the last line.
Regards,
Martin. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Martin Huschenbett
-
Niklas Broberg