Commit a9ccd37a authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #10403

parent c0aae6f6
{-# LANGUAGE PartialTypeSignatures #-}
module T10403 where
data I a = I a
instance Functor I where
fmap f (I a) = I (f a)
newtype B t a = B a
instance Functor (B t) where
fmap f (B a) = B (f a)
newtype H f = H (f ())
app :: H (B t)
app = h (H . I) (B ())
h :: _ => _
--h :: Functor m => (a -> b) -> m a -> H m
h f b = (H . fmap (const ())) (fmap f b)
T10403.hs:17:6: warning:
Found hole ‘_’ with inferred constraints: Functor f
In the type signature for ‘h’: _ => _
T10403.hs:17:11: warning:
Found hole ‘_’ with type: (a -> b) -> f a -> H f
Where: ‘f’ is a rigid type variable bound by
the inferred type of h :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:19:1
‘b’ is a rigid type variable bound by
the inferred type of h :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:19:1
‘a’ is a rigid type variable bound by
the inferred type of h :: Functor f => (a -> b) -> f a -> H f
at T10403.hs:19:1
In the type signature for ‘h’: _ => _
......@@ -46,3 +46,4 @@ test('SomethingShowable', normal, compile, ['-ddump-types -fno-warn-partial-type
test('Uncurry', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('UncurryNamed', normal, compile, ['-ddump-types -fno-warn-partial-type-signatures'])
test('WarningWildcardInstantiations', normal, compile, ['-ddump-types'])
test('T10403', normal, compile, [''])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment