| Copyright | (C) 2011-2021 Edward Kmett (C) 2015 Ørjan Johansen (C) 2016 David Feuer | 
|---|---|
| License | BSD-style (see the file LICENSE) | 
| Maintainer | Edward Kmett <ekmett@gmail.com> | 
| Stability | experimental | 
| Portability | non-portable | 
| Safe Haskell | Trustworthy | 
| Language | Haskell2010 | 
Data.Constraint.Forall
Description
This module uses a trick to provide quantification over constraints.
Synopsis
- class (forall (a :: k). p a) => Forall (p :: k -> Constraint)
- inst :: forall {k} p (a :: k). Forall p :- p a
- class Forall (ComposeC p f) => ForallF (p :: k2 -> Constraint) (f :: k1 -> k2)
- instF :: forall {k2} {k1} p (f :: k1 -> k2) (a :: k1). ForallF p f :- p (f a)
- type Forall1 (p :: k -> Constraint) = Forall p
- inst1 :: forall p (f :: Type -> Type). Forall p :- p f
- class Forall (Q p t) => ForallT (p :: k4 -> Constraint) (t :: (k1 -> k2) -> k3 -> k4)
- instT :: forall k1 k2 k3 k4 p (t :: (k1 -> k2) -> k3 -> k4) (f :: k1 -> k2) (a :: k3). ForallT p t :- p (t f a)
- type family ForallV :: k -> Constraint
- class InstV (p :: k) c | k c -> p where
- forall_ :: (forall (a :: k). Dict (p a)) -> Dict (Forall p)
Documentation
class (forall (a :: k). p a) => Forall (p :: k -> Constraint) #
Instances
| (forall (a :: k). p a) => Forall (p :: k -> Constraint) # | |
| Defined in Data.Constraint.Forall | |
inst :: forall {k} p (a :: k). Forall p :- p a #
Instantiate a quantified Forall pa.
class Forall (ComposeC p f) => ForallF (p :: k2 -> Constraint) (f :: k1 -> k2) #
A representation of the quantified constraint forall a. p (f a).
Instances
| Forall (ComposeC p f) => ForallF (p :: k2 -> Constraint) (f :: k1 -> k2) # | |
| Defined in Data.Constraint.Forall | |
instF :: forall {k2} {k1} p (f :: k1 -> k2) (a :: k1). ForallF p f :- p (f a) #
Instantiate a quantified ForallF p fa.
type Forall1 (p :: k -> Constraint) = Forall p #
inst1 :: forall p (f :: Type -> Type). Forall p :- p f #
Instantiate a quantified constraint on kind * -> *.
 This is now redundant since inst
class Forall (Q p t) => ForallT (p :: k4 -> Constraint) (t :: (k1 -> k2) -> k3 -> k4) #
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) # | |
| Defined in Data.Constraint.Forall | |
instT :: forall k1 k2 k3 k4 p (t :: (k1 -> k2) -> k3 -> k4) (f :: k1 -> k2) (a :: k3). ForallT p t :- p (t f a) #
Instantiate a quantified ForallT p tf and a.
type family ForallV :: k -> Constraint #
A representation of the quantified constraint
 forall a1 a2 ... an . p a1 a2 ... an, supporting a variable number of
 parameters.
Instances
| type ForallV # | |
| Defined in Data.Constraint.Forall type ForallV | |
class InstV (p :: k) c | k c -> p where #
Instantiate a quantified ForallV pc, where
 c ~ p a1 a2 ... an.
Instances
| p ~ c => InstV (p :: Constraint) c # | |
| Defined in Data.Constraint.Forall | |
| p a ~ c => InstV (p :: k -> Constraint) c # | |
| Defined in Data.Constraint.Forall | |
| InstV (p a) c => InstV (p :: k1 -> k2 -> k3) c # | |
| Defined in Data.Constraint.Forall | |