|
Hi,
I can't understand how the arithmatic operators like (+),(-) are defined and fromInteger works in that context. Type Fun a = Int -> a
fun :: Fun Int
fun = (+1) instance (Num a) => Num (Fun a)
where
......... (fun + 2) 10 and (2 + fun) 10 works fine. But how
does it know it has to use fromInteger?
But If I want these,
(Just 2 + fun) 10 and (fun + Just 2) 10 to work, then is there a way to tell which conversion function to use? Thanks,
Saswat |
- Re: fromInteger Saswat Anand
- Re: fromInteger Marcin 'Qrczak' Kowalczyk
