[Haskell-cafe] Type Class Query
Iavor S. Diatchki
diatchki at cse.ogi.edu
Tue Feb 3 10:29:01 EST 2004
hi,
it refers to type constructor. since value constructors are not allowed
in the "instance head" the terminology is not ambiguous.
on the other hand saying "type" would be wrong, as variables
are (in a way) types, but they are not allowed there (in Haskell'98 that
is).
hope this helps
iavor
Ketil Malde wrote:
>>>but got the following error in Hugs
>>>
>>>ERROR "C:\zero.hs":5 - Syntax error in instance head (constructor expected)
>>>
>>>
>I'm a bit puzzled by the terminology: What does "constructor" mean in
>this context? Normally, I'd use (unqualified) "constructor" to mean
>data constructor, as in Just, Nothing, Left, Right and so on.
>
>(From the obvious Prelude stuff:
> data Maybe a = Just a | Nothing
> data Either a b = Left a | Right b
>)
>
>Unless I'm completely confused, perhaps Hugs should expect a "type
>constructor" instead of just a "constructor" in its error message? Or
>perhaps it could simply say "type"?
>
>-kzm
>
>
--
==================================================
| Iavor S. Diatchki, Ph.D. student |
| Department of Computer Science and Engineering |
| School of OGI at OHSU |
| http://www.cse.ogi.edu/~diatchki |
==================================================
More information about the Haskell-Cafe
mailing list