Data.Constraint

constraints-0.9.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
- 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
- class b :=> h | h -> b where

# 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)) # |
Methods ins :: a :- Monoid (Dict a) #
a :=> (Read (Dict a)) # |
Methods ins :: a :- Read (Dict a) #
a :=> (Bounded (Dict a)) # |
Methods ins :: a :- Bounded (Dict a) #
a :=> (Enum (Dict a)) # |
Methods ins :: a :- Enum (Dict a) #
() :=> (Eq (Dict a)) # |
Methods ins :: () :- Eq (Dict a) #
() :=> (Ord (Dict a)) # |
Methods ins :: () :- Ord (Dict a) #
() :=> (Show (Dict a)) # |
Methods ins :: () :- Show (Dict a) #
a => Bounded (Dict a) # |
Methods minBound :: Dict a # maxBound :: Dict a #
a => Enum (Dict a) # |
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) # |
Methods (==) :: Dict a -> Dict a -> Bool # (/=) :: Dict a -> Dict a -> Bool #
(Typeable Constraint p, p) => Data (Dict p) # |
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) # |
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) # |
Methods readsPrec :: Int -> ReadS (Dict a) # readList :: ReadS [Dict a] # readPrec :: ReadPrec (Dict a) # readListPrec :: ReadPrec [Dict a] #
Show (Dict a) # |
Methods showsPrec :: Int -> Dict a -> ShowS # show :: Dict a -> String # showList :: [Dict a] -> ShowS #
a => Monoid (Dict a) # |
Methods mempty :: Dict a # mappend :: Dict a -> Dict a -> Dict a # mconcat :: [Dict a] -> Dict a #

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 Constraint (:-) # | Possible since GHC 7.8, when `Category` was made polykinded.
Methods id :: cat a a # (.) :: cat b c -> cat a b -> cat a c #
() :=> (Eq ((:-) a b)) # |
Methods ins :: () :- Eq (a :- b) #
() :=> (Ord ((:-) a b)) # |
Methods ins :: () :- Ord (a :- b) #
() :=> (Show ((:-) a b)) # |
Methods ins :: () :- Show (a :- b) #
Eq ((:-) a b) # | Assumes `IncoherentInstances` doesn't exist.
Methods (==) :: (a :- b) -> (a :- b) -> Bool # (/=) :: (a :- b) -> (a :- b) -> Bool #
(Typeable Constraint p, Typeable Constraint q, p, q) => Data ((:-) p q) # |
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.
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) # |
Methods showsPrec :: Int -> (a :- b) -> ShowS # show :: (a :- b) -> String # showList :: [a :- b] -> ShowS #

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

refl :: a :- a #

Reflexivity of entailment

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

class Any => Bottom #

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

Minimal complete definition

no

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'

Minimal complete definition

cls

Methods

cls :: h :- b #

Instances

Class () () # |
Methods cls :: () :- () #
Class () (Bounded a) # |
Methods cls :: Bounded a :- () #
Class () (Enum a) # |
Methods cls :: Enum a :- () #
Class () (Eq a) # |
Methods cls :: Eq a :- () #
Class () (Functor f) # |
Methods cls :: Functor f :- () #
Class () (Num a) # |
Methods cls :: Num a :- () #
Class () (Read a) # |
Methods cls :: Read a :- () #
Class () (Show a) # |
Methods cls :: Show a :- () #
Class () (Monoid a) # |
Methods cls :: Monoid a :- () #
Class b a => () :=> (Class b a) # |
Methods ins :: () :- Class b a #
Class () ((:=>) b a) # |
Methods cls :: (b :=> a) :- () #
Class () (Class b a) # |
Methods cls :: Class b a :- () #
Class (Eq a) (Bits a) # |
Methods cls :: Bits a :- Eq a #
Class (Eq a) (Ord a) # |
Methods cls :: Ord a :- Eq a #
Class (Fractional a) (Floating a) # |
Methods cls :: Floating a :- Fractional a #
Class (Functor f) (Applicative f) # |
Methods cls :: Applicative f :- Functor f #
Class (Num a) (Fractional a) # |
Methods cls :: Fractional a :- Num a #
Class (Applicative f) (Monad f) # |
Methods cls :: Monad f :- Applicative f #
Class (Applicative f) (Alternative f) # |
Methods cls :: Alternative f :- Applicative f #
Class (Monad f, Alternative f) (MonadPlus f) # |
Methods cls :: MonadPlus f :- (Monad f, Alternative f) #
Class (Num a, Ord a) (Real a) # |
Methods cls :: Real a :- (Num a, Ord a) #
Class (Real a, Fractional a) (RealFrac a) # |
Methods cls :: RealFrac a :- (Real a, Fractional a) #
Class (Real a, Enum a) (Integral a) # |
Methods cls :: Integral a :- (Real a, Enum a) #
Class (RealFrac a, Floating a) (RealFloat a) # |
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

Minimal complete definition

ins

Methods

ins :: b :- h #

Instances

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