Re: declaring a generic type in type synonyms

2002-02-21 Thread Pixel

"Andre W B Furtado" <[EMAIL PROTECTED]> writes:

> Is is possible to declare a generic type without using "data" or "newtype"?
> For example, I woud like that "pair" is a type synonym for "(t,t)" where t
> is a generic type, but just saying:
> 
> > type pair = (t,t)
> 
> won't work: i get a parse error.

- types in haskell must be capitalized (maybe a better syntax error message
would be nice, i ran into the same pb)

- "t" is a free variable, so you can't write this. Either write:

type Pair t = (t,t)
or
type Pair = (Int,Int)
or even
type Pair t1 t2 = (t1, t2)
___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



declaring a generic type in type synonyms

2002-02-21 Thread Andre W B Furtado

Is is possible to declare a generic type without using "data" or "newtype"?
For example, I woud like that "pair" is a type synonym for "(t,t)" where t
is a generic type, but just saying:

> type pair = (t,t)

won't work: i get a parse error.

Thanks,
-- Andre

___
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell