summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/typecheck/should_compile/PolyRec.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ghc-regress/typecheck/should_compile/PolyRec.hs')
-rw-r--r--testsuite/tests/ghc-regress/typecheck/should_compile/PolyRec.hs29
1 files changed, 0 insertions, 29 deletions
diff --git a/testsuite/tests/ghc-regress/typecheck/should_compile/PolyRec.hs b/testsuite/tests/ghc-regress/typecheck/should_compile/PolyRec.hs
deleted file mode 100644
index ddb911553a..0000000000
--- a/testsuite/tests/ghc-regress/typecheck/should_compile/PolyRec.hs
+++ /dev/null
@@ -1,29 +0,0 @@
--- An example of RelaxedPolyRec in action which came up
--- on Haskell Cafe June 2010 (Job Vranish)
-
-module Foo where
-
-import Data.Maybe
-
--- The fixed point datatype
-data Y f = Y (f (Y f))
-
--- Silly dummy function
-maybeToInt :: Maybe a -> Int
-maybeToInt = length . maybeToList
-
----------------------------
--- f and g are mutually recursive
--- Even though f has a totally monomorphic
--- signature, g has a very polymorphic one
-
-f :: Y Maybe -> Int
-f (Y x) = g maybeToInt x
-
--- With RelaxedPolyRec we can infer this type
--- g :: Functor f => (f Int -> b) -> f (Y Maybe) -> b
-g h x = h $ fmap f x
-
--- 'test' checks that g's type is polymophic enough
-test :: Functor f => (f Int -> b) -> f (Y Maybe) -> b
-test = g