Data.Constraint

constraints-0.8: 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
- 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)
- (&&&) :: (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`

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 #

# 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 #

# 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 because 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 them 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.

(&&&) :: (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 () (Monad f) # |
Methods cls :: Monad f :- () #
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) (Ord a) # |
Methods cls :: Ord a :- Eq a #
Class (Fractional a) (Floating a) # |
Methods cls :: Floating a :- Fractional a #
Class (Monad f) (MonadPlus f) # |
Methods cls :: MonadPlus f :- Monad f #
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) (Alternative f) # |
Methods cls :: Alternative f :- Applicative 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 ()) # |
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 Ordering) # |
Methods ins :: () :- Enum Ordering #
() :=> (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 ()) # |
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 #
() :=> (Monad ((->) a)) # |
Methods ins :: () :- Monad ((->) a) #
() :=> (Monad []) # |
Methods ins :: () :- Monad [] #
() :=> (Monad IO) # |
Methods ins :: () :- Monad IO #
() :=> (Monad (Either a)) # |
Methods ins :: () :- Monad (Either a) #
() :=> (Functor ((->) a)) # |
Methods ins :: () :- Functor ((->) 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) #
() :=> (Num Double) # |
Methods ins :: () :- Num Double #
() :=> (Num Float) # |
Methods ins :: () :- Num Float #
() :=> (Num Int) # |
Methods ins :: () :- Num Int #
() :=> (Num Integer) # |
Methods ins :: () :- Num Integer #
() :=> (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 ()) # |
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 Ordering) # |
Methods ins :: () :- Read Ordering #
() :=> (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 #
() :=> (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 Ordering) # |
Methods ins :: () :- Show Ordering #
() :=> (Show ()) # |
Methods ins :: () :- Show () #
() :=> (Show ((:-) a b)) # |
Methods ins :: () :- Show (a :- b) #
() :=> (Show (Dict a)) # |
Methods ins :: () :- Show (Dict a) #
() :=> (Applicative ((->) a)) # |
Methods ins :: () :- Applicative ((->) 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 () #
() :=> (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) :- () #
(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] #
(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) :=> (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) #
(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 (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) #
(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) #
(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 ((,) a)) # |
Methods ins :: Monoid a :- Applicative ((,) a) #
(Monoid a) :=> (Monoid (Maybe a)) # |
Methods ins :: Monoid a :- Monoid (Maybe 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) #