Refactor treatment of wildcards
[ghc.git] / testsuite / tests / partial-sigs / should_compile / T10403.hs
1 {-# LANGUAGE PartialTypeSignatures #-}
2 {-# OPTIONS_GHC -fdefer-type-errors #-}
3 module T10403 where
4
5 data I a = I a
6 instance Functor I where
7 fmap f (I a) = I (f a)
8
9 newtype B t a = B a
10 instance Functor (B t) where
11 fmap f (B a) = B (f a)
12
13 newtype H f = H (f ())
14
15 h1 :: _ => _
16 -- h :: Functor m => (a -> b) -> m a -> H m
17 h1 f b = (H . fmap (const ())) (fmap f b)
18
19 h2 :: _
20 -- MR applies
21 -- h2 :: Functor m => (a -> b) -> m a -> H m
22 h2 f b = (H . fmap (const ())) (fmap f b)
23
24 app1 :: H (B t)
25 app1 = h1 (H . I) (B ())
26
27 app2 :: H (B t)
28 app2 = h2 (H . I) (B ())