The reason is that you can define =- as on operator

so for example, in this (obfuscated) code:

(=-) x y = x * y

sq y = y =- y

Thus, in your code, you had an operator on the LHS of the definition, and the interpreter baulked at it.

Bob

On 27 Sep 2005, at 10:34, [EMAIL PROTECTED] wrote:


Hi
i can not load program test1 into hugs, but test2 works.
Am i missing some special syntax?

greetings,
Philip

-------------- test1 ------------------

foo :: Maybe Int -> Int
foo Nothing =-1
foo (Just a)= a

-------------- test2 ------------------

foo :: Maybe Int -> Int
foo Nothing = -1
--           ^
--           +-- note an extra space
foo (Just a)= a
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to