[Haskell-cafe] Are there arithmetic composition of functions?
cdsmith at gmail.com
Mon Mar 19 18:37:11 CET 2012
If you are willing to depend on a recent version of base where Num is no
longer a subclass of Eq and Show, it is also fine to do this:
instance Num a => Num (r -> a) where
(f + g) x = f x + g x
fromInteger = const . fromInteger
and so on.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe