[clean-list] uniqueness question
John van Groningen
johnvg at cs.ru.nl
Tue Nov 17 15:43:51 MET 2009
Vag Vagoff wrote:
>It is very convenient to use
>
> class (+) infixl 6 a :: !*a !a -> .a
>
Unfortunately if the compiler would permit this type and if 'a' cannot be
coerced the following functions would be rejected by the typechecker:
f a b = a+(b+a) // because a cannot have type *a and a
g a b c
# x = a+b
| True
= x+c
= c+x
// x cannot have type *a and a in different alternatives
Kind regards,
John van Groningen
More information about the clean-list
mailing list