TypeCompose-0.3: Type composition classes & instancesSource codeContentsIndex
Portabilitymulti-parameter type classes
Make function-like things
Dissect function-like things
Dual dissections
Some function-like classes, having lambda-like construction. See LambdaTy for why lambda. See Data.Pair for similar classes.
type LambdaTy src snk = forall a b. src a -> snk b -> snk (a -> b)
class Lambda src snk where
lambda :: LambdaTy src snk
class Unlambda src snk | snk -> src where
unlambda :: snk (a -> b) -> (src a, snk b)
fsrc :: snk (a -> b) -> src a
fres :: snk (a -> b) -> snk b
class Colambda f where
cores :: f b -> f (a -> b)
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 whereSource
Type constructor class for function-like things having lambda-like construction.
:: LambdaTy src snkForm a function-like value
show/hide Instances
Lambda IO OI
Lambda IO OI
Applicative f => Lambda f (f :->: Const o)
Applicative f => Lambda f (Flip (->) o :. f)
Applicative f => Lambda f (f :. Flip (->) o)
Lambda Id (Flip (->) o)
Lambda Id (Flip (->) o)
(Lambda src snk, Lambda dom' ran') => Lambda (src :*: dom') (snk :*: ran')
(Arrow ~>, Unlambda f f', Lambda g g') => Lambda (Arrw ~> f g) (Arrw ~> f' g')
Dissect function-like things
class Unlambda src snk | snk -> src whereSource
Like Unpair, but for functions. Minimal instance definition: either (a) unlambda or (b) both of fsrc and fres.
unlambda :: snk (a -> b) -> (src a, snk b)Source
Deconstruct pair-like value
fsrc :: snk (a -> b) -> src aSource
First part of pair-like value
fres :: snk (a -> b) -> snk bSource
Second part of pair-like value
show/hide Instances
Dual dissections
class Colambda f whereSource
Like Copair, but for functions
cores :: f b -> f (a -> b)Source
show/hide Instances
Produced by Haddock version 2.3.0