summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T5853.hs
blob: 6375691ea45f68dd4091444e7f5979ccce19202a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE NoImplicitPrelude, TypeFamilies #-}

module T5853 where
import Prelude (undefined,Bool(..),Show(..),(.))

type family Elem f :: *
type family Subst f b :: *

class (Subst fa (Elem fa) ~ fa) => F fa where
        (<$>) :: (Elem fa ~ a, Elem fb ~ b,
                  Subst fa b ~ fb, Subst fb a ~ fa) =>
                         (a -> b) -> (fa -> fb)

{-# RULES
 "map/map" forall f g xs. f <$> (g <$> xs) = (f.g) <$> xs
        #-}