Can Class do this?
Marcin 'Qrczak' Kowalczyk
qrczak@knm.org.pl
6 Mar 2001 17:10:24 GMT
Wed, 7 Mar 2001 01:00:05 -0800, Saswat Anand <iscp9157@nus.edu.sg> pisze:
> But it has a small problem. I also want to be able to write
>
> 4 \+ fc :: CF
> fc \+ 4 :: CF
> ic \+ 4 :: IF
> 4 \+ fc \+ ic :: CIF
You can have more fundeps which allow to deduce a type of an argument
from the other argument and the result:
| a b -> c, a c -> b, b c -> a
and make CF and IF instances of Integral (define fromIntegral for them).
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK