Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
Stores a constraint context. When pattern matched upon, the compiler knows the constraint is true.
class HasClass c t b | c t -> b where Source #
Identifies whether or not a type has an instance of a type class,
and provides a standard means for capturing a context that allows them
to be used.
Unfortunately, because instances cannot be selected on the basis of
whether a context matches, instances of this class need to be listed manually
whenever we need to modify behaviour depending on whether an instance
of a class is available or not. If a class c
has an instance for type t
there should be an instance HasClass c t True where classDict _ _ _ = TDict
.
For cases where additional context is required, see examples in the
Data.Type.HasClassPreludeInstances
module.