diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2015-05-13 17:17:22 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2015-05-18 13:43:16 +0100 |
commit | f1f265df0742b7214f3b909190f5a171819392b5 (patch) | |
tree | e3d32156e40910eef063574889bb16474a550a94 /testsuite/tests/partial-sigs/should_compile/T10403.hs | |
parent | 3f42de51ab2de697089917ee71feec9a7333dd0d (diff) | |
download | haskell-f1f265df0742b7214f3b909190f5a171819392b5.tar.gz |
Test Trac #10403
Diffstat (limited to 'testsuite/tests/partial-sigs/should_compile/T10403.hs')
-rw-r--r-- | testsuite/tests/partial-sigs/should_compile/T10403.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T10403.hs b/testsuite/tests/partial-sigs/should_compile/T10403.hs new file mode 100644 index 0000000000..a33646da5d --- /dev/null +++ b/testsuite/tests/partial-sigs/should_compile/T10403.hs @@ -0,0 +1,19 @@ +{-# 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) |