first-class-instances-1.0.0.0: First class typeclass instances
Safe HaskellNone
LanguageHaskell2010

FCI.Base

Description

Dictionaries for base classes.

Synopsis

Dictionary types

data DictEq a Source #

Dictionary type for Eq

Constructors

Eq 

Fields

data DictOrd a Source #

Dictionary type for Ord

Constructors

Ord 

Fields

data DictSemigroup a Source #

Dictionary type for Semigroup

Constructors

Semigroup 

Fields

data DictMonoid a Source #

Dictionary type for Monoid

Constructors

Monoid 

Fields

data DictShow a Source #

Dictionary type for Show

Constructors

Show 

Fields

data DictRead a Source #

Dictionary type for Read

Constructors

Read 

data DictEnum a Source #

Dictionary type for Enum

Constructors

Enum 

Fields

data DictBounded a Source #

Dictionary type for Bounded

Constructors

Bounded 

Fields

data DictNum a Source #

Dictionary type for Num

Constructors

Num 

Fields

data DictReal a Source #

Dictionary type for Real

Constructors

Real 

Fields

data DictIntegral a Source #

Dictionary type for Integral

Constructors

Integral 

Fields

data DictFractional a Source #

Dictionary type for Fractional

Constructors

Fractional 

Fields

data DictFloating a Source #

Dictionary type for Floating

Constructors

Floating 

Fields

data DictRealFrac a Source #

Dictionary type for RealFrac

Constructors

RealFrac 

Fields

data DictRealFloat a Source #

Dictionary type for RealFloat

Constructors

RealFloat 

Fields

data DictBits a Source #

Dictionary type for Bits

Constructors

Bits 

Fields

data DictFiniteBits b Source #

Dictionary type for FiniteBits

Constructors

FiniteBits 

Fields

data DictIx a Source #

Dictionary type for Ix

Constructors

Ix 

Fields

data DictFunctor (f :: Type -> Type) Source #

Dictionary type for Functor

Constructors

Functor 

Fields

  • _fmap :: forall a b. (a -> b) -> f a -> f b
     
  • (|<$) :: forall a b. a -> f b -> f a
     

data DictContravariant (f :: Type -> Type) Source #

Dictionary type for Contravariant

Constructors

Contravariant 

Fields

  • _contramap :: forall a' a. (a' -> a) -> f a -> f a'
     
  • (|>$) :: forall b a. b -> f b -> f a
     

data DictApplicative (f :: Type -> Type) Source #

Dictionary type for Applicative

Constructors

Applicative 

Fields

  • _Functor :: Dict (Functor f)
     
  • _pure :: forall a. a -> f a
     
  • (|<*>) :: forall a b. f (a -> b) -> f a -> f b
     
  • _liftA2 :: forall a b c. (a -> b -> c) -> f a -> f b -> f c
     
  • (|*>) :: forall a b. f a -> f b -> f b
     
  • (|<*) :: forall a b. f a -> f b -> f a
     

data DictAlternative (f :: Type -> Type) Source #

Dictionary type for Alternative

Constructors

Alternative 

Fields

data DictMonad (m :: Type -> Type) Source #

Dictionary type for Monad

Constructors

Monad 

Fields

data DictMonadFail (m :: Type -> Type) Source #

Dictionary type for MonadFail

Constructors

MonadFail 

Fields

data DictMonadPlus (m :: Type -> Type) Source #

Dictionary type for MonadPlus

Constructors

MonadPlus 

Fields

data DictMonadFix (m :: Type -> Type) Source #

Dictionary type for MonadFix

Constructors

MonadFix 

Fields

data DictFoldable (t :: Type -> Type) Source #

Dictionary type for Foldable

Constructors

Foldable 

Fields

data DictTraversable (t :: Type -> Type) Source #

Dictionary type for Traversable

Constructors

Traversable 

Fields

data DictBifunctor (p :: Type -> Type -> Type) Source #

Dictionary type for Bifunctor

Constructors

Bifunctor 

Fields

  • _Functor :: Dict (forall a. Functor (p a))
     
  • _bimap :: forall a b c d. (a -> b) -> (c -> d) -> p a c -> p b d
     
  • _first :: forall a b c. (a -> b) -> p a c -> p b c
     
  • _second :: forall b c a. (b -> c) -> p a b -> p a c
     

data DictBifoldable (p :: Type -> Type -> Type) Source #

Dictionary type for Bifoldable

Constructors

Bifoldable 

Fields

  • _bifold :: forall m. Monoid m => p m m -> m
     
  • _bifoldMap :: forall m a b. Monoid m => (a -> m) -> (b -> m) -> p a b -> m
     
  • _bifoldr :: forall a c b. (a -> c -> c) -> (b -> c -> c) -> c -> p a b -> c
     
  • _bifoldl :: forall c a b. (c -> a -> c) -> (c -> b -> c) -> c -> p a b -> c
     

data DictBitraversable (t :: Type -> Type -> Type) Source #

Dictionary type for Bitraversable

Constructors

Bitraversable 

Fields

data DictException e Source #

Dictionary type for Exception

data DictCategory (cat :: k -> k -> Type) Source #

Dictionary type for Category

Constructors

Category 

Fields

  • _id :: forall (a :: k). cat a a
     
  • (|.) :: forall (b :: k) (c :: k) (a :: k). cat b c -> cat a b -> cat a c
     

data DictArrow (a :: Type -> Type -> Type) Source #

Dictionary type for Arrow

Constructors

Arrow 

Fields

  • _Category :: Dict (Category a)
     
  • _arr :: forall b c. (b -> c) -> a b c
     
  • _first :: forall b c d. a b c -> a (b, d) (c, d)
     
  • _second :: forall b c d. a b c -> a (d, b) (d, c)
     
  • (|***) :: forall b c b' c'. a b c -> a b' c' -> a (b, b') (c, c')
     
  • (|&&&) :: forall b c c'. a b c -> a b c' -> a b (c, c')
     

data DictArrowZero (a :: Type -> Type -> Type) Source #

Dictionary type for ArrowZero

Constructors

ArrowZero 

Fields

data DictArrowPlus (a :: Type -> Type -> Type) Source #

Dictionary type for ArrowPlus

Constructors

ArrowPlus 

Fields

data DictArrowChoice (a :: Type -> Type -> Type) Source #

Dictionary type for ArrowChoice

Constructors

ArrowChoice 

Fields

data DictArrowApply (a :: Type -> Type -> Type) Source #

Dictionary type for ArrowApply

Constructors

ArrowApply 

Fields

data DictArrowLoop (a :: Type -> Type -> Type) Source #

Dictionary type for ArrowLoop

Constructors

ArrowLoop 

Fields

data DictStorable a Source #

Dictionary type for Storable

Constructors

Storable 

Fields

Default dictionaries

fmapFunctor :: (forall a b. (a -> b) -> f a -> f b) -> Dict (Functor f) Source #

Default Functor dictionary requiring only fmap.

viaFunctor :: forall (f :: Type -> Type) (g :: Type -> Type). (Coercible f g, Functor f) => Dict (Functor g) Source #

Functor dictionary for a type coercible to another that has a Functor instance.

This definition is actually quite limited in applicability. A better definition would use the quantified constraint (forall a. Coercible (f a) (g a)).

applyApplicative Source #

Arguments

:: (forall a. a -> f a)

pure

-> (forall a b. f (a -> b) -> f a -> f b)

(<*>)

-> Dict (Applicative f) 

Default Applicative dictionary requiring only pure and (<*>).

liftA2Applicative Source #

Arguments

:: (forall a. a -> f a)

pure

-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)

liftA2

-> Dict (Applicative f) 

Default Applicative dictionary requiring only pure and liftA2.

bindMonad Source #

Arguments

:: (forall a. a -> m a)

return

-> (forall a b. m a -> (a -> m b) -> m b)

(>>=)

-> Dict (Monad m) 

Default Monad dictionary requiring only return and (>>=).

joinMonad Source #

Arguments

:: (forall a b. (a -> b) -> m a -> m b)

fmap

-> (forall a. a -> m a)

return

-> (forall a. m (m a) -> m a)

join

-> Dict (Monad m) 

Default Monad dictionary requiring only fmap, return, and join.