Testsuite: delete Windows line endings [skip ci] (#11631)
[ghc.git] / testsuite / tests / typecheck / should_fail / T4875.hs
1 {-# OPTIONS -XMultiParamTypeClasses -XFunctionalDependencies -XFlexibleInstances #-}
2 module HaskellBug where
3
4 data Relation c -- The basic Relation
5 = Rel { relnm :: String -- The name of the relation
6 , relsrc :: c -- Source concept
7 , reltrg :: c -- ^Target concept
8 }
9 deriving Eq
10
11 -- This declaration is ok; should not get an error here
12 class (Eq concept)=> Association rel concept | rel -> concept where
13 source, target :: rel -> concept
14 -- e.g. Declaration Concept -> Concept
15 sign :: rel -> (concept,concept)
16 sign x = (source x,target x)
17 homogeneous :: rel -> Bool
18 homogeneous s = source s == target s
19
20 instance (Eq c)=>Association (Relation c) c where
21 source = relsrc
22 target = reltrg
23
24 -- This declaration has a kind error
25 -- The error should be reported here
26 class (Eq c, Association r c) => Morphic r c where
27 multiplicities :: r c -> [c]
28 multiplicities _ = []