summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail044.hs
blob: b271d0f9770fd698fb74b0d385514d42dd5fb03e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- !!! tcfail044: duplicated type variable in instance decls
--
module ShouldFail where

instance (Eq a) => Eq (a->a)
instance Show (a->b)

instance (Num a) => Num (a->a) where
    f + g    = \x -> f x + g x
    negate f = \x -> - (f x)
    f * g    = \x -> f x * g x
    fromInteger n = \x -> fromInteger n

ss :: Float -> Float
cc :: Float -> Float
tt :: Float -> Float

ss = sin * sin
cc = cos * cos
tt = ss + cc

--main = putStr ((show (tt 0.4))++ "  "++(show (tt 1.652)))