id summary reporter owner description type status priority milestone component version resolution keywords cc os architecture failure testcase blockedby blocking related differential wikipage
7019 Wrong error message when using forall in constraints sjoerd_visscher simonpj "I tried this in GHC 7.4.1:
{{{
{-# LANGUAGE ConstraintKinds, RankNTypes, UndecidableInstances #-}
newtype Free c a = Free { runFree :: forall r. c r => (a -> r) -> r }
type C c = forall a. c (Free c a)
instance C c => Monad (Free c) where
return a = Free ($ a)
Free f >>= g = f g
}}}
Which gives this error:
{{{
Could not deduce (c (Free c b)) arising from a use of `f'
from the context (C c)
}}}
So apparently the forall is silently dropped.
Without UndecidableInstances the error is:
{{{
Illegal irreducible constraint forall a. c (Free c a)
in superclass/instance head context (Use -XUndecidableInstances to permit this)
}}}
giving the impression that it is allowed." bug closed normal Compiler 7.4.1 fixed Unknown/Multiple Unknown/Multiple None/Unknown typecheck/should_fail/T7019, T7019a