summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/tcfail044.hs
blob: 09d756693f4bc0d6686476b288b1590109666c6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{-# LANGUAGE Haskell2010 #-}
-- !!! 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)))