constraints-0.14.2: 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

- type Constraint = CONSTRAINT LiftedRep
- data Dict a where
  - Dict :: forall a. a => Dict a
- class HasDict c e | e -> c where
  - evidence :: e -> Dict c
- withDict :: HasDict c e => e -> (c => r) -> r
- (\\) :: HasDict c e => (c => r) -> e -> r
- newtype a :- b = Sub (a => Dict b)
- type (⊢) = (:-)
- class (p => q) => p |- q
- class (p, q) => p & q
- 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
- implied :: (a => b) => a :- b
- class (Any :: Constraint) => 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

type Constraint = CONSTRAINT LiftedRep #

The kind of lifted constraints

# Dictionary

data Dict a 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 :: forall a. a => Dict a |

#### Instances

Instances details

() :=> (Semigroup (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Semigroup (Dict a) #
() :=> (Show (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show (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) #
a :=> (Monoid (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Monoid (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) #
a :=> (Read (Dict a)) # |
Instance details Defined in Data.Constraint Methods ins :: a :- Read (Dict a) #
HasDict a (Dict a) # |
Instance details Defined in Data.Constraint Methods evidence :: Dict a -> Dict a #
c => Boring (Dict c) # |
Instance details Defined in Data.Constraint Methods boring :: Dict c #
NFData (Dict c) # |
Instance details Defined in Data.Constraint Methods rnf :: Dict c -> () #
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 #
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 #
(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 :: forall r r'. (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) #

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] #
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 #
Eq (Dict a) # |
Instance details Defined in Data.Constraint Methods (==) :: Dict a -> Dict a -> Bool # (/=) :: Dict a -> Dict a -> Bool #
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 #

class HasDict c e | e -> c where #

Witnesses that a value of type `e` contains evidence of the constraint `c`.

Mainly intended to allow (`\\`) to be overloaded, since it's a useful operator.

Methods

evidence :: e -> Dict c #

#### Instances

Instances details

HasDict a (Dict a) # |
Instance details Defined in Data.Constraint Methods evidence :: Dict a -> Dict a #
a => HasDict b (a :- b) # |
Instance details Defined in Data.Constraint Methods evidence :: (a :- b) -> Dict b #
HasDict (Typeable k, Typeable a) (TypeRep a) # |
Instance details Defined in Data.Constraint Methods evidence :: TypeRep a -> Dict (Typeable k, Typeable a) #
HasDict (Coercible a b) (Coercion a b) # |
Instance details Defined in Data.Constraint Methods evidence :: Coercion a b -> Dict (Coercible a b) #
HasDict (a ~ b) (a :~: b) # |
Instance details Defined in Data.Constraint Methods evidence :: (a :~: b) -> Dict (a ~ b) #
HasDict (a ~~ b) (a :~~: b) # |
Instance details Defined in Data.Constraint Methods evidence :: (a :~~: b) -> Dict (a ~~ b) #

withDict :: HasDict c e => e -> (c => 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.

Can also be used to deconstruct an entailment, `a `:-` b`, using a context `a`.

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

(\\) :: HasDict c e => (c => r) -> e -> r infixl 1 #

Operator version of `withDict`, with the arguments flipped

# 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

Instances details

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 #
() :=> (Show (a :- b)) # |
Instance details Defined in Data.Constraint Methods ins :: () :- Show (a :- b) #
() :=> (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) #
a => HasDict b (a :- b) # |
Instance details Defined in Data.Constraint Methods evidence :: (a :- b) -> Dict b #
a => NFData (a :- b) # |
Instance details Defined in Data.Constraint Methods rnf :: (a :- b) -> () #
(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 :: forall r r'. (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) #

Show (a :- b) # |
Instance details Defined in Data.Constraint Methods showsPrec :: Int -> (a :- b) -> ShowS # show :: (a :- b) -> String # showList :: [a :- b] -> ShowS #
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 #
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 #

type (⊢) = (:-) infixr 9 #

Type entailment, as written with a single character.

class (p => q) => p |- q #

The internal hom for the category of constraints.

This version can be passed around inside Dict, whereas (a => b) is impredicative

    foo :: Dict (Ord a => Eq a)
    foo = Dict

fails to typecheck due to the lack of impredicative polymorphism, but

    foo :: Dict (Ord a |- Eq a)
    foo = Dict

typechecks just fine.

#### Instances

Instances details

(p => q) => p |- q # |
Instance details Defined in Data.Constraint

class (p, q) => p & q #

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 we can define an equivalent type, that converts back and forth to `(,)`, and lets you hang instances.

#### Instances

Instances details

(p, q) => p & q # |
Instance details Defined in Data.Constraint

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

refl :: a :- a #

Reflexivity of entailment

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

implied :: (a => b) => a :- b #

Convert a quantified constraint into an entailment.

class (Any :: Constraint) => 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

Instances details

Class () () # |
Instance details Defined in Data.Constraint Methods cls :: () :- () #
Class () (Functor f) # |
Instance details Defined in Data.Constraint Methods cls :: Functor f :- () #
Class () (Semigroup a) # |
Instance details Defined in Data.Constraint Methods cls :: Semigroup a :- () #
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 () (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 () (Eq a) # |
Instance details Defined in Data.Constraint Methods cls :: Eq 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 (Applicative f) (Alternative f) # |
Instance details Defined in Data.Constraint Methods cls :: Alternative f :- Applicative f #
Class (Applicative f) (Monad f) # |
Instance details Defined in Data.Constraint Methods cls :: Monad f :- Applicative f #
Class (Functor f) (Applicative f) # |
Instance details Defined in Data.Constraint Methods cls :: Applicative f :- Functor f #
Class (Semigroup a) (Monoid a) # |
Instance details Defined in Data.Constraint Methods cls :: Monoid a :- Semigroup a #
Class (Num a) (Fractional a) # |
Instance details Defined in Data.Constraint Methods cls :: Fractional a :- Num a #
Class (Fractional a) (Floating a) # |
Instance details Defined in Data.Constraint Methods cls :: Floating a :- Fractional 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 (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, Enum a) (Integral a) # |
Instance details Defined in Data.Constraint Methods cls :: Integral a :- (Real a, Enum a) #
Class (Real a, Fractional a) (RealFrac a) # |
Instance details Defined in Data.Constraint Methods cls :: RealFrac a :- (Real a, Fractional 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

Instances details

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