exists-0.2: Existential datatypes holding evidence of constraints

Safe HaskellSafe-Infered



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.



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


(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.


Empty k a