(no subject)

Ashley Yakeley ashley@semantic.org
Fri, 13 Sep 2002 12:18:38 -0700


At 2002-09-13 12:12, Richard Barth wrote:

>I'm just learning Haskell with Hugs98. I can't understand why the line
>defining "foo" is acceptable while the line defining "bar" (only
>difference is the unary minus) generates the error message at the end.
>If someone could explain this, or, better yet, tell me how I can figure
>this out for myself. Thanks.
> 
>data Entry = Ent {date :: String, amount :: Double}
>foo = [Ent "baz"  1.0]
>bar = [Ent "baz" -1.0]

Haskell thinks it's a binary minus. Try this:

  bar = [Ent "baz" (-1.0)]


-- 
Ashley Yakeley, Seattle WA