TypeCompose-0.9.14: Type composition classes & instances

Copyright(c) Conal Elliott 2007
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Portabilitymulti-parameter type classes
Safe HaskellNone
LanguageHaskell98

Data.Lambda

Contents

Description

Some function-like classes, having lambda-like construction. See LambdaTy for why "lambda". See Data.Pair for similar classes.

Synopsis

Make function-like things

type LambdaTy src snk = forall a b. src a -> snk b -> snk (a -> b) Source #

Type of lambda method. Think of src as the bound variable (or pattern) part of a lambda and snk as the expression part. They combine to form a function-typed expression. Instance template:

  instance (Applicative f, Lambda src snk)
    => Lambda (f :. src) (f :. snk) where
      lambda = apLambda

class Lambda src snk where Source #

Type constructor class for function-like things having lambda-like construction.

Methods

lambda Source #

Arguments

:: LambdaTy src snk

Form a function-like value

Instances
Lambda IO OI Source # 
Instance details

Defined in Data.Lambda

Applicative f => Lambda f (f :->: (Const o :: Type -> Type)) Source # 
Instance details

Defined in Data.Lambda

Methods

lambda :: LambdaTy f (f :->: Const o) Source #

Applicative f => Lambda f (Flip ((->) :: Type -> Type -> Type) o :. f) Source # 
Instance details

Defined in Data.Lambda

Methods

lambda :: LambdaTy f (Flip (->) o :. f) Source #

Applicative f => Lambda f (f :. Flip ((->) :: Type -> Type -> Type) o) Source # 
Instance details

Defined in Data.Lambda

Methods

lambda :: LambdaTy f (f :. Flip (->) o) Source #

Lambda Id (Flip ((->) :: Type -> Type -> Type) o) Source # 
Instance details

Defined in Data.Lambda

Methods

lambda :: LambdaTy Id (Flip (->) o) Source #

(Lambda src snk, Lambda dom' ran') => Lambda (src :*: dom') (snk :*: ran') Source # 
Instance details

Defined in Data.Lambda

Methods

lambda :: LambdaTy (src :*: dom') (snk :*: ran') Source #

(Arrow j, Unlambda f f', Lambda g g') => Lambda (Arrw j f g) (Arrw j f' g') Source # 
Instance details

Defined in Data.Lambda

Methods

lambda :: LambdaTy (Arrw j f g) (Arrw j f' g') Source #

Dissect function-like things

class Unlambda src snk | snk -> src where Source #

Like Unpair, but for functions. Minimal instance definition: either (a) unlambda or (b) both of fsrc and fres.

Minimal complete definition

Nothing

Methods

unlambda :: snk (a -> b) -> (src a, snk b) Source #

Deconstruct pair-like value

fsrc :: snk (a -> b) -> src a Source #

First part of pair-like value

fres :: snk (a -> b) -> snk b Source #

Second part of pair-like value

Instances
Unlambda Endo Endo Source # 
Instance details

Defined in Data.Lambda

Methods

unlambda :: Endo (a -> b) -> (Endo a, Endo b) Source #

fsrc :: Endo (a -> b) -> Endo a Source #

fres :: Endo (a -> b) -> Endo b Source #

Dual dissections

class Colambda f where Source #

Like Copair, but for functions

Methods

cores :: f b -> f (a -> b) Source #

Instances
Colambda Endo Source # 
Instance details

Defined in Data.Lambda

Methods

cores :: Endo b -> Endo (a -> b) Source #