
27 Sep
2005
27 Sep
'05
1:36 p.m.
Am Dienstag, 27. September 2005 11:34 schrieb feucht@uni-koblenz.de:
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
Hello, obviously, Hugs thinks that =- is a special operator. In Haskell you have the ability to define your own operators, so it would be possible to define an operator =-. I would suggest that you always put spaces around the = in declarations. Best wishes, Wolfgang