[Haskell-cafe] newbe question
Thomas Davie
tom.davie at gmail.com
Mon Sep 26 21:00:42 EDT 2005
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, feucht at uni-koblenz.de 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
More information about the Haskell-Cafe
mailing list