exists-0.1: Existential datatypes holding evidence of constraints

Safe HaskellSafe-Infered

Control.Constraint.Combine

Description

This module contains a type-level combinator for combining constraint constructors.

This is useful because you can't otherwise write an Exists type or Existential instance referencing more than one at the same time.

Synopsis

Documentation

class (c a, d a) => (c :&: d) a Source

Combine two constraint constructors of kind χ -> Constraint, where χ is any kind.

This is the same as

 type (c :&: d) a = (c a, d a)

except that it can be partially applied.

 f :: ((Eq :&: Enum :&: Bounded) a) => a -> Bool

is equivalent to

 f :: (Eq a, Enum a, Bounded a) => a -> Bool

Instances

(c a, d a) => (k :&: c) d a 

type And c d = c :&: dSource

The same as :&:.

class Empty a Source

An empty constraint which implies nothing.

:&: and Empty form a type-level monoid with Empty as the identity element.

Instances

Empty k a