[Haskell-cafe] Class constraints with "free" type variables and fundeps

Alexander Solla alex.solla at gmail.com
Sat Sep 29 02:19:36 CEST 2012

On Fri, Sep 28, 2012 at 5:04 PM, Francesco Mazzoli <f at mazzo.li> wrote:

> CCing the list back.
> At Fri, 28 Sep 2012 13:30:52 -0700,
> Alexander Solla wrote:
> > What is the problem, exactly?  It looks to me like UndecidableInstances
> and
> > ScopedTypeVariables (on foo, or its arguments) would be enough.
> I'm not sure what you mean.  I don't see the need for
> UndecidableInstances, and
> there is no way I can see to bring the `b' into scope in the type sig for
> foo,
> ScopedTypeVariables or not - unless I'm missing something.

Well, then what exactly is the problem?  Are you getting an error?

You don't need to bring 'b' into scope.  You will already have real types
in scope.

instance Foo A B
instance Bar A where foo A B = C

tryIt = (foo :: A -> B -> C) A B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120928/1e93f979/attachment.htm>

More information about the Haskell-Cafe mailing list