Bump `base` version to 4.9.0.0 (closes #11026)
[ghc.git] / testsuite / tests / typecheck / should_fail / T10698.hs
1 {-# LANGUAGE RoleAnnotations #-}
2
3 module T10698 where
4 import Data.Coerce
5
6 data Map k a = Map k a
7 type role Map nominal representational
8
9 map1 :: (k1->k2) -> Map k1 a -> Map k2 a
10 map1 f (Map a b) = Map (f a) b
11 {-# NOINLINE [1] map1 #-}
12 {-# RULES
13 "map1/coerce" map1 coerce = coerce
14 #-}
15
16
17 map2 :: (a -> b) -> Map k a -> Map k b
18 map2 f (Map a b) = Map a (f b)
19 {-# NOINLINE [1] map2 #-}
20
21 {-# RULES
22 "map2/coerce" map2 coerce = coerce
23 #-}