[Haskell-cafe] type-level integers, type-level operators, and most specific overlapping instance

adam vogt vogt.adam at gmail.com
Sun Sep 22 17:38:25 CEST 2013


On Sun, Sep 22, 2013 at 11:07 AM, TP <paratribulations at free.fr> wrote:
> My misunderstanding came from a confusion between a "context" and a
> "constraint". The context is what is before the =>, and the constraint is
> what is after, i.e. the main part of the instance declaration.

Hi TP,

I think context and constraint mean the same thing. The haskell report
uses the word context for
<http://www.haskell.org/onlinereport/decls.html> for the whole list
and constraint for one part of that list (Eq a). With the extension
-XConstraintKinds both of those are called Constraint. In other words:

> instance Context => InstanceHead
>
> instance (Constraint, Constraint2) => InstanceHead

Regards,
Adam



More information about the Haskell-Cafe mailing list