[project @ 1999-06-09 09:35:54 by simonpj]
[ghc-hetmet.git] / ghc / tests / typecheck / should_fail / tcfail044.hs
1 -- !!! tcfail044: duplicated type variable in instance decls
2 --
3 module ShouldFail where
4
5 instance (Eq a) => Eq (a->a)
6 instance Show (a->b)
7
8 instance (Num a) => Num (a->a) where
9     f + g    = \x -> f x + g x
10     negate f = \x -> - (f x)
11     f * g    = \x -> f x * g x
12     fromInteger n = \x -> fromInteger n
13
14 ss :: Float -> Float
15 cc :: Float -> Float
16 tt :: Float -> Float
17
18 ss = sin * sin
19 cc = cos * cos
20 tt = ss + cc
21
22 --main = putStr ((show (tt 0.4))++ "  "++(show (tt 1.652)))