
6 Oct
2009
6 Oct
'09
7:40 p.m.
Soenke Hahn schrieb:
If you want to use number literals, you have to implement an instance for Algebra.Ring.C, if i understand correctly. Is there any special reason, why fromInteger is a method of Algebra.Ring.C?
Yes, Ring is the most basic class in the hierarchy that provides a zero, a one and addition, thus you could implement fromInteger by successively adding or subtracting one from zero, given some basic operations on Integer. 'fromInteger' just allows a more efficient implementation.