
13 Sep
2002
13 Sep
'02
3:12 p.m.
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] Type checking...... ERROR "...test.hs":7 - Unresolved top-level overloading *** Binding : bar *** Outstanding context : Fractional (Double -> Entry)