Commit 3a33a98f authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #4917

parent 82c8c4d5
{-# LANGUAGE GADTs, ScopedTypeVariables, EmptyDataDecls, RankNTypes #-}
module T4917 where
-- only works on ghc6 but not on ghc7
type Const a b = a
newtype Fix f n = In { out :: f (Fix f) n }
mcata :: forall f a b .
(forall x c . (forall d . x d -> Const b d) -> f x c -> Const b c)
-> Fix f a -> Const b a
mcata f x = f {- x=(Fix f), c=a -} mcataf outx
where
outx :: f (Fix f) a
outx = out x
mcataf :: forall d. Fix f d -> Const b d
mcataf y = mcata {- f=f, a=d, b=b0 -} f (y :: Fix f d)
-- Const b d ~ Const b0 d
-- Expected type of f :: forall x c. (forall d. x d -> Const b0 d) -> f x c -> Const b0 c
......@@ -335,4 +335,5 @@ test('T4418', normal, compile, [''])
test('T4444', normal, compile, [''])
test('T4498', normal, compile, [''])
test('T4524', normal, compile, [''])
test('T4917', 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