[Haskell] Empty instance declaration

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Thu Jan 3 08:23:03 EST 2008


ajb at spamcop.net wrote:

> One thing that hasn't come up yet is that empty instance declarations
> are the only decent option (that I know of) that we have in the
> absence of real class aliases.

It does seem to me that compilers could reasonably distinguish between
incomplete definition:

> > class (Monad m, Ord t) => ReVars m t where { }
> > instance (Monad m, Ord t) => ReVars m t where { }

and intentionally incomplete definition:

    class (Monad m, Ord t) => ReVars m t
    instance (Monad m, Ord t) => ReVars m t

Both syntaxes (with and without the 'where') are currently legal, but
the latter is more obviously deliberate (at least to this human reader).

Regards,
    Malcolm


More information about the Haskell mailing list