1 Jun
2001
1 Jun
'01
10:25 p.m.
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
9219
Age (days ago)
9219
Last active (days ago)
0 comments
1 participants
participants (1)
-
Saswat Anand