Data.Constraint

constraints-0.10.1: Constraint manipulation

Copyright | (C) 2011-2015 Edward Kmett
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

Contents

- The Kind of Constraints
- Dictionary
- Entailment
- Dict is fully faithful
- Reflection

Description

`ConstraintKinds` made type classes into types of a new kind, `Constraint`.

    Eq :: * -> Constraint
    Ord :: * -> Constraint
    Monad :: (* -> *) -> Constraint

The need for this extension was first publicized in the paper

Scrap your boilerplate with class: extensible generic functions

by Ralf Lämmel and Simon Peyton Jones in 2005, which shoehorned all the things they needed into a custom `Sat` typeclass.

With `ConstraintKinds` we can put into code a lot of tools for manipulating these new types without such awkward workarounds.

Synopsis

- data Constraint
- data Dict :: Constraint -> * where
  - Dict :: a => Dict a
- withDict :: Dict a -> (a => r) -> r
- newtype a :- b = Sub (a => Dict b)
- (\\) :: a => (b => r) -> (a :- b) -> r
- weaken1 :: (a, b) :- a
- weaken2 :: (a, b) :- b
- contract :: a :- (a, a)
- strengthen1 :: Dict b -> (a :- c) -> a :- (b, c)
- strengthen2 :: Dict b -> (a :- c) -> a :- (c, b)
- (&&&) :: (a :- b) -> (a :- c) -> a :- (b, c)
- (***) :: (a :- b) -> (c :- d) -> (a, c) :- (b, d)
- trans :: (b :- c) -> (a :- b) -> a :- c
- refl :: a :- a
- class Any => Bottom where
  - no :: a
- top :: a :- ()
- bottom :: Bottom :- a
- mapDict :: (a :- b) -> Dict a -> Dict b
- unmapDict :: (Dict a -> Dict b) -> a :- b
- class Class b h | h -> b where
  - cls :: h :- b
- class b :=> h | h -> b where
  - ins :: b :- h

# The Kind of Constraints

data Constraint #

The kind of constraints, like `Show a`

# Dictionary

data Dict :: Constraint -> * where #

Values of type ``Dict` p` capture a dictionary for a constraint of type `p`.

e.g.

    Dict :: Dict (Eq Int)

captures a dictionary that proves we have an:

    instance Eq 'Int

Pattern matching on the `Dict` constructor will bring this instance into scope.

Constructors

Dict :: a => Dict a |

Instances

a :=> (Monoid (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Monoid (Dict a) #
a :=> (Read (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Read (Dict a) #
a :=> (Bounded (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Bounded (Dict a) #
a :=> (Enum (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Enum (Dict a) #
() :=> (Eq (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq (Dict a) #
() :=> (Ord (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord (Dict a) #
() :=> (Show (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show (Dict a) #
() :=> (Semigroup (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Semigroup (Dict a) #
a => Bounded (Dict a) # |
Instance details Defined in Data.Constraint Methods minBound :: Dict a # maxBound :: Dict a #
a => Enum (Dict a) # |
Instance details Defined in Data.Constraint Methods succ :: Dict a -> Dict a # pred :: Dict a -> Dict a # toEnum :: Int -> Dict a # fromEnum :: Dict a -> Int # enumFrom :: Dict a -> [Dict a] # enumFromThen :: Dict a -> Dict a -> [Dict a] # enumFromTo :: Dict a -> Dict a -> [Dict a] # enumFromThenTo :: Dict a -> Dict a -> Dict a -> [Dict a] #
Eq (Dict a) # |
Instance details Defined in Data.Constraint Methods (==) :: Dict a -> Dict a -> Bool # (/=) :: Dict a -> Dict a -> Bool #
(Typeable p, p) => Data (Dict p) # |
Instance details Defined in Data.Constraint Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dict p -> c (Dict p) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dict p) # toConstr :: Dict p -> Constr # dataTypeOf :: Dict p -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Dict p)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dict p)) # gmapT :: (forall b. Data b => b -> b) -> Dict p -> Dict p # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dict p -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dict p -> r # gmapQ :: (forall d. Data d => d -> u) -> Dict p -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dict p -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dict p -> m (Dict p) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dict p -> m (Dict p) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dict p -> m (Dict p) #
Ord (Dict a) # |
Instance details Defined in Data.Constraint Methods compare :: Dict a -> Dict a -> Ordering # (<) :: Dict a -> Dict a -> Bool # (<=) :: Dict a -> Dict a -> Bool # (>) :: Dict a -> Dict a -> Bool # (>=) :: Dict a -> Dict a -> Bool # max :: Dict a -> Dict a -> Dict a # min :: Dict a -> Dict a -> Dict a #
a => Read (Dict a) # |
Instance details Defined in Data.Constraint Methods readsPrec :: Int -> ReadS (Dict a) # readList :: ReadS [Dict a] # readPrec :: ReadPrec (Dict a) # readListPrec :: ReadPrec [Dict a] #
Show (Dict a) # |
Instance details Defined in Data.Constraint Methods showsPrec :: Int -> Dict a -> ShowS # show :: Dict a -> String # showList :: [Dict a] -> ShowS #
Semigroup (Dict a) # |
Instance details Defined in Data.Constraint Methods (<>) :: Dict a -> Dict a -> Dict a # sconcat :: NonEmpty (Dict a) -> Dict a # stimes :: Integral b => b -> Dict a -> Dict a #
a => Monoid (Dict a) # |
Instance details Defined in Data.Constraint Methods mempty :: Dict a # mappend :: Dict a -> Dict a -> Dict a # mconcat :: [Dict a] -> Dict a #
NFData (Dict c) # |
Instance details Defined in Data.Constraint Methods rnf :: Dict c -> () #

withDict :: Dict a -> (a => r) -> r #

From a `Dict`, takes a value in an environment where the instance witnessed by the `Dict` is in scope, and evaluates it.

Essentially a deconstruction of a `Dict` into its continuation-style form.

# Entailment

newtype a :- b infixr 9 #

This is the type of entailment.

`a `:-` b` is read as `a` "entails" `b`.

With this we can actually build a category for `Constraint` resolution.

e.g.

Because ``Eq` a` is a superclass of ``Ord` a`, we can show that ``Ord` a` entails ``Eq` a`.

Because `instance `Ord` a => `Ord` [a]` exists, we can show that ``Ord` a` entails ``Ord` [a]` as well.

This relationship is captured in the `:-` entailment type here.

Since `p `:-` p` and entailment composes, `:-` forms the arrows of a `Category` of constraints. However, `Category` only became sufficiently general to support this instance in GHC 7.8, so prior to 7.8 this instance is unavailable.

But due to the coherence of instance resolution in Haskell, this `Category` has some very interesting properties. Notably, in the absence of `IncoherentInstances`, this category is "thin", which is to say that between any two objects (constraints) there is at most one distinguishable arrow.

This means that for instance, even though there are two ways to derive ``Ord` a `:-` `Eq` [a]`, the answers from these two paths _must_ by construction be equal. This is a property that Haskell offers that is pretty much unique in the space of languages with things they call "type classes".

What are the two ways?

Well, we can go from ``Ord` a `:-` `Eq` a` via the superclass relationship, and then from ``Eq` a `:-` `Eq` [a]` via the instance, or we can go from ``Ord` a `:-` `Ord` [a]` via the instance then from ``Ord` [a] `:-` `Eq` [a]` through the superclass relationship and this diagram by definition must "commute".

Diagrammatically,

                       Ord a
                   ins /     \ cls
                      v       v
                Ord [a]     Eq a
                   cls \     / ins
                        v   v
                       Eq [a]

This safety net ensures that pretty much anything you can write with this library is sensible and can't break any assumptions on the behalf of library authors.

Constructors

Sub (a => Dict b) |

Instances

Category (:-) # | Possible since GHC 7.8, when `Category` was made polykinded.
Instance details Defined in Data.Constraint Methods id :: a :- a # (.) :: (b :- c) -> (a :- b) -> a :- c #
() :=> (Eq (a :- b)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq (a :- b) #
() :=> (Ord (a :- b)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord (a :- b) #
() :=> (Show (a :- b)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show (a :- b) #
Eq (a :- b) # | Assumes `IncoherentInstances` doesn't exist.
Instance details Defined in Data.Constraint Methods (==) :: (a :- b) -> (a :- b) -> Bool # (/=) :: (a :- b) -> (a :- b) -> Bool #
(Typeable p, Typeable q, p, q) => Data (p :- q) # |
Instance details Defined in Data.Constraint Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> (p :- q) -> c (p :- q) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (p :- q) # toConstr :: (p :- q) -> Constr # dataTypeOf :: (p :- q) -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (p :- q)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (p :- q)) # gmapT :: (forall b. Data b => b -> b) -> (p :- q) -> p :- q # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (p :- q) -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (p :- q) -> r # gmapQ :: (forall d. Data d => d -> u) -> (p :- q) -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> (p :- q) -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> (p :- q) -> m (p :- q) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (p :- q) -> m (p :- q) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (p :- q) -> m (p :- q) #
Ord (a :- b) # | Assumes `IncoherentInstances` doesn't exist.
Instance details Defined in Data.Constraint Methods compare :: (a :- b) -> (a :- b) -> Ordering # (<) :: (a :- b) -> (a :- b) -> Bool # (<=) :: (a :- b) -> (a :- b) -> Bool # (>) :: (a :- b) -> (a :- b) -> Bool # (>=) :: (a :- b) -> (a :- b) -> Bool # max :: (a :- b) -> (a :- b) -> a :- b # min :: (a :- b) -> (a :- b) -> a :- b #
Show (a :- b) # |
Instance details Defined in Data.Constraint Methods showsPrec :: Int -> (a :- b) -> ShowS # show :: (a :- b) -> String # showList :: [a :- b] -> ShowS #
a => NFData (a :- b) # |
Instance details Defined in Data.Constraint Methods rnf :: (a :- b) -> () #

(\\) :: a => (b => r) -> (a :- b) -> r infixl 1 #

Given that `a :- b`, derive something that needs a context `b`, using the context `a`

weaken1 :: (a, b) :- a #

Weakening a constraint product

The category of constraints is Cartesian. We can forget information.

weaken2 :: (a, b) :- b #

Weakening a constraint product

The category of constraints is Cartesian. We can forget information.

contract :: a :- (a, a) #

Contracting a constraint / diagonal morphism

The category of constraints is Cartesian. We can reuse information.

strengthen1 :: Dict b -> (a :- c) -> a :- (b, c) #

strengthen2 :: Dict b -> (a :- c) -> a :- (c, b) #

(&&&) :: (a :- b) -> (a :- c) -> a :- (b, c) #

Constraint product

    trans weaken1 (f &&& g) = f
    trans weaken2 (f &&& g) = g

(***) :: (a :- b) -> (c :- d) -> (a, c) :- (b, d) #

due to the hack for the kind of `(,)` in the current version of GHC we can't actually make instances for `(,) :: Constraint -> Constraint -> Constraint`, but `(,)` is a bifunctor on the category of constraints. This lets us map over both sides.

trans :: (b :- c) -> (a :- b) -> a :- c #

Transitivity of entailment

If we view `(`:-`)` as a Constraint-indexed category, then this is `(`Category`)`

refl :: a :- a #

Reflexivity of entailment

If we view `(`:-`)` as a Constraint-indexed category, then this is `Category`

class Any => Bottom where #

`Any` inhabits every kind, including `Constraint` but is uninhabited, making it impossible to define an instance.

Methods

no :: a #

top :: a :- () #

Every constraint implies truth

These are the terminal arrows of the category, and `()` is the terminal object.

Given any constraint there is a unique entailment of the `()` constraint from that constraint.

bottom :: Bottom :- a #

This demonstrates the law of classical logic "ex falso quodlibet"

# Dict is fully faithful

mapDict :: (a :- b) -> Dict a -> Dict b #

Apply an entailment to a dictionary.

From a category theoretic perspective `Dict` is a functor that maps from the category of constraints (with arrows in `:-`) to the category Hask of Haskell data types.

unmapDict :: (Dict a -> Dict b) -> a :- b #

This functor is fully faithful, which is to say that given any function you can write `Dict a -> Dict b` there also exists an entailment `a :- b` in the category of constraints that you can build.

# Reflection

class Class b h | h -> b where #

Reify the relationship between a class and its superclass constraints as a class

Given a definition such as

    class Foo a => Bar a

you can capture the relationship between 'Bar a' and its superclass 'Foo a' with

    instance Class (Foo a) (Bar a) where cls = Sub Dict

Now the user can use 'cls :: Bar a :- Foo a'

Methods

cls :: h :- b #

Instances

Class () () # |
Instance details Defined in Data.Constraint Methods cls :: () :- () #
Class () (Bounded a) # |
Instance details Defined in Data.Constraint Methods cls :: Bounded a :- () #
Class () (Enum a) # |
Instance details Defined in Data.Constraint Methods cls :: Enum a :- () #
Class () (Eq a) # |
Instance details Defined in Data.Constraint Methods cls :: Eq a :- () #
Class () (Functor f) # |
Instance details Defined in Data.Constraint Methods cls :: Functor f :- () #
Class () (Num a) # |
Instance details Defined in Data.Constraint Methods cls :: Num a :- () #
Class () (Read a) # |
Instance details Defined in Data.Constraint Methods cls :: Read a :- () #
Class () (Show a) # |
Instance details Defined in Data.Constraint Methods cls :: Show a :- () #
Class () (Semigroup a) # |
Instance details Defined in Data.Constraint Methods cls :: Semigroup a :- () #
Class b a => () :=> (Class b a) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Class b a #
Class () (b :=> a) # |
Instance details Defined in Data.Constraint Methods cls :: (b :=> a) :- () #
Class () (Class b a) # |
Instance details Defined in Data.Constraint Methods cls :: Class b a :- () #
Class (Eq a) (Bits a) # |
Instance details Defined in Data.Constraint Methods cls :: Bits a :- Eq a #
Class (Eq a) (Ord a) # |
Instance details Defined in Data.Constraint Methods cls :: Ord a :- Eq a #
Class (Fractional a) (Floating a) # |
Instance details Defined in Data.Constraint Methods cls :: Floating a :- Fractional a #
Class (Functor f) (Applicative f) # |
Instance details Defined in Data.Constraint Methods cls :: Applicative f :- Functor f #
Class (Num a) (Fractional a) # |
Instance details Defined in Data.Constraint Methods cls :: Fractional a :- Num a #
Class (Applicative f) (Monad f) # |
Instance details Defined in Data.Constraint Methods cls :: Monad f :- Applicative f #
Class (Applicative f) (Alternative f) # |
Instance details Defined in Data.Constraint Methods cls :: Alternative f :- Applicative f #
Class (Semigroup a) (Monoid a) # |
Instance details Defined in Data.Constraint Methods cls :: Monoid a :- Semigroup a #
Class (Monad f, Alternative f) (MonadPlus f) # |
Instance details Defined in Data.Constraint Methods cls :: MonadPlus f :- (Monad f, Alternative f) #
Class (Num a, Ord a) (Real a) # |
Instance details Defined in Data.Constraint Methods cls :: Real a :- (Num a, Ord a) #
Class (Real a, Fractional a) (RealFrac a) # |
Instance details Defined in Data.Constraint Methods cls :: RealFrac a :- (Real a, Fractional a) #
Class (Real a, Enum a) (Integral a) # |
Instance details Defined in Data.Constraint Methods cls :: Integral a :- (Real a, Enum a) #
Class (RealFrac a, Floating a) (RealFloat a) # |
Instance details Defined in Data.Constraint Methods cls :: RealFloat a :- (RealFrac a, Floating a) #

class b :=> h | h -> b where infixr 9 #

Reify the relationship between an instance head and its body as a class

Given a definition such as

    instance Foo a => Foo [a]

you can capture the relationship between the instance head and its body with

    instance Foo a :=> Foo [a] where ins = Sub Dict

Methods

ins :: b :- h #

Instances

() :=> () # |
Instance details Defined in Data.Constraint Methods ins :: () :- () #
a :=> (Monoid (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Monoid (Dict a) #
a :=> (Read (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Read (Dict a) #
a :=> (Bounded (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Bounded (Dict a) #
a :=> (Enum (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Enum (Dict a) #
() :=> (Bounded Bool) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bounded Bool #
() :=> (Bounded Char) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bounded Char #
() :=> (Bounded Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bounded Int #
() :=> (Bounded Ordering) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bounded Ordering #
() :=> (Bounded Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bounded Word #
() :=> (Bounded ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bounded () #
() :=> (Enum Bool) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Bool #
() :=> (Enum Char) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Char #
() :=> (Enum Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Double #
() :=> (Enum Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Float #
() :=> (Enum Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Int #
() :=> (Enum Integer) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Integer #
() :=> (Enum Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Natural #
() :=> (Enum Ordering) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Ordering #
() :=> (Enum Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum Word #
() :=> (Enum ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Enum () #
() :=> (Eq Bool) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq Bool #
() :=> (Eq Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq Double #
() :=> (Eq Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq Float #
() :=> (Eq Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq Int #
() :=> (Eq Integer) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq Integer #
() :=> (Eq Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq Natural #
() :=> (Eq Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq Word #
() :=> (Eq ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq () #
() :=> (Eq (a :- b)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq (a :- b) #
() :=> (Eq (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Eq (Dict a) #
() :=> (Floating Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Floating Double #
() :=> (Floating Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Floating Float #
() :=> (Fractional Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Fractional Double #
() :=> (Fractional Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Fractional Float #
() :=> (Integral Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Integral Int #
() :=> (Integral Integer) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Integral Integer #
() :=> (Integral Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Integral Natural #
() :=> (Integral Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Integral Word #
() :=> (Monad ((->) a :: Type -> Type)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monad ((->) a) #
() :=> (Monad []) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monad [] #
() :=> (Monad IO) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monad IO #
() :=> (Monad (Either a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monad (Either a) #
() :=> (Monad Identity) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monad Identity #
() :=> (Functor ((->) a :: Type -> Type)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor ((->) a) #
() :=> (Functor []) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor [] #
() :=> (Functor Maybe) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor Maybe #
() :=> (Functor IO) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor IO #
() :=> (Functor (Either a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor (Either a) #
() :=> (Functor ((,) a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor ((,) a) #
() :=> (Functor Identity) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor Identity #
() :=> (Functor (Const a :: Type -> Type)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Functor (Const a) #
() :=> (Num Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Num Double #
() :=> (Num Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Num Float #
() :=> (Num Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Num Int #
() :=> (Num Integer) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Num Integer #
() :=> (Num Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Num Natural #
() :=> (Num Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Num Word #
() :=> (Ord Bool) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Bool #
() :=> (Ord Char) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Char #
() :=> (Ord Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Double #
() :=> (Ord Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Float #
() :=> (Ord Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Int #
() :=> (Ord Integer) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Integer #
() :=> (Ord Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Natural #
() :=> (Ord Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord Word #
() :=> (Ord ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord () #
() :=> (Ord (a :- b)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord (a :- b) #
() :=> (Ord (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Ord (Dict a) #
() :=> (Read Bool) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Read Bool #
() :=> (Read Char) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Read Char #
() :=> (Read Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Read Int #
() :=> (Read Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Read Natural #
() :=> (Read Ordering) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Read Ordering #
() :=> (Read Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Read Word #
() :=> (Read ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Read () #
() :=> (Real Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Real Double #
() :=> (Real Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Real Float #
() :=> (Real Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Real Int #
() :=> (Real Integer) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Real Integer #
() :=> (Real Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Real Natural #
() :=> (Real Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Real Word #
() :=> (RealFloat Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- RealFloat Double #
() :=> (RealFloat Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- RealFloat Float #
() :=> (RealFrac Double) # |
Instance details Defined in Data.Constraint Methods ins :: () :- RealFrac Double #
() :=> (RealFrac Float) # |
Instance details Defined in Data.Constraint Methods ins :: () :- RealFrac Float #
() :=> (Show Bool) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show Bool #
() :=> (Show Char) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show Char #
() :=> (Show Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show Int #
() :=> (Show Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show Natural #
() :=> (Show Ordering) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show Ordering #
() :=> (Show Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show Word #
() :=> (Show ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show () #
() :=> (Show (a :- b)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show (a :- b) #
() :=> (Show (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show (Dict a) #
() :=> (Applicative ((->) a :: Type -> Type)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Applicative ((->) a) #
() :=> (Applicative []) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Applicative [] #
() :=> (Applicative Maybe) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Applicative Maybe #
() :=> (Applicative IO) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Applicative IO #
() :=> (Applicative (Either a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Applicative (Either a) #
() :=> (Semigroup [a]) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Semigroup [a] #
() :=> (Semigroup Ordering) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Semigroup Ordering #
() :=> (Semigroup ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Semigroup () #
() :=> (Semigroup (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Semigroup (Dict a) #
() :=> (Monoid [a]) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monoid [a] #
() :=> (Monoid Ordering) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monoid Ordering #
() :=> (Monoid ()) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Monoid () #
() :=> (Bits Bool) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bits Bool #
() :=> (Bits Int) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bits Int #
() :=> (Bits Integer) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bits Integer #
() :=> (Bits Natural) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bits Natural #
() :=> (Bits Word) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Bits Word #
() :=> (Alternative []) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Alternative [] #
() :=> (Alternative Maybe) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Alternative Maybe #
() :=> (MonadPlus []) # |
Instance details Defined in Data.Constraint Methods ins :: () :- MonadPlus [] #
() :=> (MonadPlus Maybe) # |
Instance details Defined in Data.Constraint Methods ins :: () :- MonadPlus Maybe #
b :=> a => () :=> (b :=> a) # |
Instance details Defined in Data.Constraint Methods ins :: () :- (b :=> a) #
Class b a => () :=> (Class b a) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Class b a #
Class () (b :=> a) # |
Instance details Defined in Data.Constraint Methods cls :: (b :=> a) :- () #
(Bounded a) :=> (Bounded (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Bounded a :- Bounded (Const a b) #
(Bounded a) :=> (Bounded (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Bounded a :- Bounded (Identity a) #
(Enum a) :=> (Enum (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Enum a :- Enum (Const a b) #
(Enum a) :=> (Enum (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Enum a :- Enum (Identity a) #
(Eq a) :=> (Eq (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Eq a :- Eq (Const a b) #
(Eq a) :=> (Eq (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Eq a :- Eq (Identity a) #
(Eq a) :=> (Eq (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: Eq a :- Eq (Ratio a) #
(Eq a) :=> (Eq (Complex a)) # |
Instance details Defined in Data.Constraint Methods ins :: Eq a :- Eq (Complex a) #
(Eq a) :=> (Eq (Maybe a)) # |
Instance details Defined in Data.Constraint Methods ins :: Eq a :- Eq (Maybe a) #
(Eq a) :=> (Eq [a]) # |
Instance details Defined in Data.Constraint Methods ins :: Eq a :- Eq [a] #
(Floating a) :=> (Floating (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Floating a :- Floating (Const a b) #
(Floating a) :=> (Floating (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Floating a :- Floating (Identity a) #
(Fractional a) :=> (Fractional (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Fractional a :- Fractional (Const a b) #
(Fractional a) :=> (Fractional (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Fractional a :- Fractional (Identity a) #
(Integral a) :=> (RealFrac (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- RealFrac (Ratio a) #
(Integral a) :=> (Fractional (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- Fractional (Ratio a) #
(Integral a) :=> (Integral (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- Integral (Const a b) #
(Integral a) :=> (Integral (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- Integral (Identity a) #
(Integral a) :=> (Real (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- Real (Ratio a) #
(Integral a) :=> (Num (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- Num (Ratio a) #
(Integral a) :=> (Enum (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- Enum (Ratio a) #
(Integral a) :=> (Ord (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: Integral a :- Ord (Ratio a) #
(Monad m) :=> (Applicative (WrappedMonad m)) # |
Instance details Defined in Data.Constraint Methods ins :: Monad m :- Applicative (WrappedMonad m) #
(Monad m) :=> (Functor (WrappedMonad m)) # |
Instance details Defined in Data.Constraint Methods ins :: Monad m :- Functor (WrappedMonad m) #
(Num a) :=> (Num (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Num a :- Num (Const a b) #
(Num a) :=> (Num (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Num a :- Num (Identity a) #
(Ord a) :=> (Ord (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Ord a :- Ord (Const a b) #
(Ord a) :=> (Ord (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Ord a :- Ord (Identity a) #
(Ord a) :=> (Ord [a]) # |
Instance details Defined in Data.Constraint Methods ins :: Ord a :- Ord [a] #
(Ord a) :=> (Ord (Maybe a)) # |
Instance details Defined in Data.Constraint Methods ins :: Ord a :- Ord (Maybe a) #
(Read a) :=> (Read (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Read a :- Read (Const a b) #
(Read a) :=> (Read (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Read a :- Read (Identity a) #
(Read a) :=> (Read (Maybe a)) # |
Instance details Defined in Data.Constraint Methods ins :: Read a :- Read (Maybe a) #
(Read a) :=> (Read [a]) # |
Instance details Defined in Data.Constraint Methods ins :: Read a :- Read [a] #
(Read a) :=> (Read (Complex a)) # |
Instance details Defined in Data.Constraint Methods ins :: Read a :- Read (Complex a) #
(Real a) :=> (Real (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Real a :- Real (Const a b) #
(Real a) :=> (Real (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Real a :- Real (Identity a) #
(RealFloat a) :=> (RealFloat (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: RealFloat a :- RealFloat (Const a b) #
(RealFloat a) :=> (RealFloat (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: RealFloat a :- RealFloat (Identity a) #
(RealFloat a) :=> (Floating (Complex a)) # |
Instance details Defined in Data.Constraint Methods ins :: RealFloat a :- Floating (Complex a) #
(RealFloat a) :=> (Fractional (Complex a)) # |
Instance details Defined in Data.Constraint Methods ins :: RealFloat a :- Fractional (Complex a) #
(RealFloat a) :=> (Num (Complex a)) # |
Instance details Defined in Data.Constraint Methods ins :: RealFloat a :- Num (Complex a) #
(RealFrac a) :=> (RealFrac (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: RealFrac a :- RealFrac (Const a b) #
(RealFrac a) :=> (RealFrac (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: RealFrac a :- RealFrac (Identity a) #
(Show a) :=> (Show (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Show a :- Show (Const a b) #
(Show a) :=> (Show (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Show a :- Show (Identity a) #
(Show a) :=> (Show (Maybe a)) # |
Instance details Defined in Data.Constraint Methods ins :: Show a :- Show (Maybe a) #
(Show a) :=> (Show [a]) # |
Instance details Defined in Data.Constraint Methods ins :: Show a :- Show [a] #
(Show a) :=> (Show (Complex a)) # |
Instance details Defined in Data.Constraint Methods ins :: Show a :- Show (Complex a) #
(Semigroup a) :=> (Semigroup (IO a)) # |
Instance details Defined in Data.Constraint Methods ins :: Semigroup a :- Semigroup (IO a) #
(Semigroup a) :=> (Semigroup (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Semigroup a :- Semigroup (Identity a) #
(Semigroup a) :=> (Semigroup (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Semigroup a :- Semigroup (Const a b) #
(Semigroup a) :=> (Semigroup (Maybe a)) # |
Instance details Defined in Data.Constraint Methods ins :: Semigroup a :- Semigroup (Maybe a) #
(Monoid a) :=> (Applicative (Const a :: Type -> Type)) # |
Instance details Defined in Data.Constraint Methods ins :: Monoid a :- Applicative (Const a) #
(Monoid a) :=> (Applicative ((,) a)) # |
Instance details Defined in Data.Constraint Methods ins :: Monoid a :- Applicative ((,) a) #
(Monoid a) :=> (Monoid (IO a)) # |
Instance details Defined in Data.Constraint Methods ins :: Monoid a :- Monoid (IO a) #
(Monoid a) :=> (Monoid (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Monoid a :- Monoid (Identity a) #
(Monoid a) :=> (Monoid (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Monoid a :- Monoid (Const a b) #
(Monoid a) :=> (Monoid (Maybe a)) # |
Instance details Defined in Data.Constraint Methods ins :: Monoid a :- Monoid (Maybe a) #
(Bits a) :=> (Bits (Const a b)) # |
Instance details Defined in Data.Constraint Methods ins :: Bits a :- Bits (Const a b) #
(Bits a) :=> (Bits (Identity a)) # |
Instance details Defined in Data.Constraint Methods ins :: Bits a :- Bits (Identity a) #
(MonadPlus m) :=> (Alternative (WrappedMonad m)) # |
Instance details Defined in Data.Constraint Methods ins :: MonadPlus m :- Alternative (WrappedMonad m) #
(Bounded a, Bounded b) :=> (Bounded (a, b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Bounded a, Bounded b) :- Bounded (a, b) #
(Eq a, Eq b) :=> (Eq (Either a b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Eq a, Eq b) :- Eq (Either a b) #
(Eq a, Eq b) :=> (Eq (a, b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Eq a, Eq b) :- Eq (a, b) #
(Integral a, Read a) :=> (Read (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: (Integral a, Read a) :- Read (Ratio a) #
(Integral a, Show a) :=> (Show (Ratio a)) # |
Instance details Defined in Data.Constraint Methods ins :: (Integral a, Show a) :- Show (Ratio a) #
(Ord a, Ord b) :=> (Ord (Either a b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Ord a, Ord b) :- Ord (Either a b) #
(Ord a, Ord b) :=> (Ord (a, b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Ord a, Ord b) :- Ord (a, b) #
(Read a, Read b) :=> (Read (Either a b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Read a, Read b) :- Read (Either a b) #
(Read a, Read b) :=> (Read (a, b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Read a, Read b) :- Read (a, b) #
(Show a, Show b) :=> (Show (Either a b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Show a, Show b) :- Show (Either a b) #
(Show a, Show b) :=> (Show (a, b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Show a, Show b) :- Show (a, b) #
(Semigroup a, Semigroup b) :=> (Semigroup (a, b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Semigroup a, Semigroup b) :- Semigroup (a, b) #
(Monoid a, Monoid b) :=> (Monoid (a, b)) # |
Instance details Defined in Data.Constraint Methods ins :: (Monoid a, Monoid b) :- Monoid (a, b) #