1 -- !!! Defines functions as an instance of Num
5 instance (Eq a, Eq b) => Eq (a->b)
8 instance Show (a->b) where
9 show f = "<<function>>"
11 instance (Num a, Num b) => Num (a->b) where
12 f + g = \x -> f x + g x
13 negate f = \x -> - (f x)
14 f * g = \x -> f x * g x
15 fromInteger n = \x -> fromInteger n
24 -- sin**2 + cos**2 = 1
26 main = putStrLn ((show (tt 0.4))++ " "++(show (tt 1.652)))