implicit params in instance contexts

Shachaf Ben-Kiki shachaf at
Tue Jul 16 10:29:33 CEST 2013

On Mon, Jul 15, 2013 at 11:21 PM, Ganesh Sittampalam <ganesh at> wrote:
> Hi,
> It seems that from GHC 7.4, the prohibition on implicit parameter
> constraints in instance declarations has been relaxed. The program below
> gives the error "Illegal constraint ?fooRev::Bool" in GHC 7.2.1 but
> loads fine in GHC 7.4.2 and GHC 7.6.2.
> I can't spot anything about this in the release notes, and the
> documentation
> (
> still says "You can't have an implicit parameter in the context of a
> class or instance declaration."
> So I wonder if this happened by accident, perhaps as part of the
> ConstraintKinds work or similar?
> I've wanted this feature a few times so if it's going to stay I might
> start using it. However it is a bit dangerous, so if it was added by
> accident it might warrant some discussion before deciding to keep it.
> For example as the value "set2" below shows, it can be used to violate
> datatype invariants.

There was a post about this previously:
And a GHC ticket:
See also the discussion at


More information about the Glasgow-haskell-users mailing list