constraints-0.10.1: Constraint manipulation

Copyright(C) 2011-2015 Edward Kmett
(C) 2015 Ørjan Johansen
(C) 2016 David Feuer
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Constraint.Forall

Description

This module uses a trick to provide quantification over constraints.

Synopsis

Documentation

type family Forall (p :: k -> Constraint) :: Constraint Source #

A representation of the quantified constraint forall a. p a.

Instances
type Forall (p :: k -> Constraint) Source # 
Instance details

Defined in Data.Constraint.Forall

type Forall (p :: k -> Constraint)

inst :: forall p a. Forall p :- p a Source #

Instantiate a quantified Forall p constraint at type a.

class Forall (ComposeC p f) => ForallF (p :: k2 -> Constraint) (f :: k1 -> k2) Source #

A representation of the quantified constraint forall a. p (f a).

Instances
Forall (ComposeC p f) => ForallF (p :: k2 -> Constraint) (f :: k1 -> k2) Source # 
Instance details

Defined in Data.Constraint.Forall

instF :: forall p f a. ForallF p f :- p (f a) Source #

Instantiate a quantified ForallF p f constraint at type a.

type Forall1 p = Forall p Source #

inst1 :: forall (p :: (* -> *) -> Constraint) (f :: * -> *). Forall p :- p f Source #

Instantiate a quantified constraint on kind * -> *. This is now redundant since inst became polykinded.

class Forall (Q p t) => ForallT (p :: k4 -> Constraint) (t :: (k1 -> k2) -> k3 -> k4) Source #

A representation of the quantified constraint forall f a. p (t f a).

Instances
Forall (Q p t) => ForallT (p :: k4 -> Constraint) (t :: (k1 -> k2) -> k3 -> k4) Source # 
Instance details

Defined in Data.Constraint.Forall

instT :: forall (p :: k4 -> Constraint) (t :: (k1 -> k2) -> k3 -> k4) (f :: k1 -> k2) (a :: k3). ForallT p t :- p (t f a) Source #

Instantiate a quantified ForallT p t constraint at types f and a.

type family ForallV :: k -> Constraint Source #

A representation of the quantified constraint forall a1 a2 ... an . p a1 a2 ... an, supporting a variable number of parameters.

Instances
type ForallV Source # 
Instance details

Defined in Data.Constraint.Forall

type ForallV

class InstV (p :: k) c | k c -> p where Source #

Instantiate a quantified ForallV p constraint as c, where c ~ p a1 a2 ... an.

Minimal complete definition

instV

Methods

instV :: ForallV p :- c Source #

Instances
p ~ c => InstV (p :: Constraint) c Source # 
Instance details

Defined in Data.Constraint.Forall

Associated Types

type ForallV' p :: Constraint

Methods

instV :: ForallV p :- c Source #

InstV (p a) c => InstV (p :: k1 -> k2 -> k3) c Source # 
Instance details

Defined in Data.Constraint.Forall

Associated Types

type ForallV' p :: Constraint

Methods

instV :: ForallV p :- c Source #

p a ~ c => InstV (p :: k -> Constraint) c Source # 
Instance details

Defined in Data.Constraint.Forall

Associated Types

type ForallV' p :: Constraint

Methods

instV :: ForallV p :- c Source #

forall :: forall p. (forall a. Dict (p a)) -> Dict (Forall p) Source #