Take account of injectivity when doing fundeps
[ghc.git] / testsuite / tests / typecheck / should_fail / T5853.hs
1 {-# LANGUAGE NoImplicitPrelude, TypeFamilies #-}
2
3 module T5853 where
4 import Prelude (undefined,Bool(..),Show(..),(.))
5
6 type family Elem f :: *
7 type family Subst f b :: *
8
9 class (Subst fa (Elem fa) ~ fa) => F fa where
10 (<$>) :: (Elem fa ~ a, Elem fb ~ b,
11 Subst fa b ~ fb, Subst fb a ~ fa) =>
12 (a -> b) -> (fa -> fb)
13
14 {-# RULES
15 "map/map" forall f g xs. f <$> (g <$> xs) = (f.g) <$> xs
16 #-}