| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Control.CCA
- (>>>) :: Category k cat => cat a b -> cat b c -> cat a c
- (<<<) :: Category k cat => cat b c -> cat a b -> cat a c
- first :: Arrow a => forall b c d. a b c -> a (b, d) (c, d)
- second :: Arrow a => forall b c d. a b c -> a (d, b) (d, c)
- (***) :: Arrow a => forall b c b' c'. a b c -> a b' c' -> a (b, b') (c, c')
- (&&&) :: Arrow a => forall b c c'. a b c -> a b c' -> a b (c, c')
- loop :: ArrowLoop a => forall b d c. a (b, d) (c, d) -> a b c
- class Category * a => Arrow a where
- class Arrow a => ArrowLoop a where
- loop :: a (b, d) (c, d) -> a b c
- class (Arrow a, ArrowLoop a) => ArrowInit a where
- arr :: ExpQ -> ExpQ
- init :: ExpQ -> ExpQ
- constant :: (ArrowInit a, Lift b) => b -> a () b
- norm :: ASyn t t1 -> ExpQ
- normOpt :: ASyn t t1 -> ExpQ
Documentation
first :: Arrow a => forall b c d. a b c -> a (b, d) (c, d)
Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.
second :: Arrow a => forall b c d. a b c -> a (d, b) (d, c)
A mirror image of first.
The default definition may be overridden with a more efficient version if desired.
(***) :: Arrow a => forall b c b' c'. a b c -> a b' c' -> a (b, b') (c, c')
Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.
The default definition may be overridden with a more efficient version if desired.
(&&&) :: Arrow a => forall b c c'. a b c -> a b c' -> a b (c, c')
Fanout: send the input to both argument arrows and combine their output.
The default definition may be overridden with a more efficient version if desired.
class Category * a => Arrow a where
The basic arrow class.
Minimal complete definition: arr and first, satisfying the laws
arrid =idarr(f >>> g) =arrf >>>arrgfirst(arrf) =arr(firstf)first(f >>> g) =firstf >>>firstgfirstf >>>arrfst=arrfst>>> ffirstf >>>arr(id*** g) =arr(id*** g) >>>firstffirst(firstf) >>>arrassoc=arrassoc>>>firstf
where
assoc ((a,b),c) = (a,(b,c))
The other combinators have sensible default definitions, which may be overridden for efficiency.
Methods
first :: a b c -> a (b, d) (c, d)
Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.
second :: a b c -> a (d, b) (d, c)
A mirror image of first.
The default definition may be overridden with a more efficient version if desired.
(***) :: a b c -> a b' c' -> a (b, b') (c, c') infixr 3
Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.
The default definition may be overridden with a more efficient version if desired.
(&&&) :: a b c -> a b c' -> a b (c, c') infixr 3
Fanout: send the input to both argument arrows and combine their output.
The default definition may be overridden with a more efficient version if desired.
class Arrow a => ArrowLoop a where
The loop operator expresses computations in which an output value
is fed back as input, although the computation occurs only once.
It underlies the rec value recursion construct in arrow notation.
loop should satisfy the following laws:
- extension
loop(arrf) =arr(\ b ->fst(fix(\ (c,d) -> f (b,d))))- left tightening
loop(firsth >>> f) = h >>>loopf- right tightening
loop(f >>>firsth) =loopf >>> h- sliding
loop(f >>>arr(id*** k)) =loop(arr(id*** k) >>> f)- vanishing
loop(loopf) =loop(arrunassoc >>> f >>>arrassoc)- superposing
second(loopf) =loop(arrassoc >>>secondf >>>arrunassoc)
where
assoc ((a,b),c) = (a,(b,c)) unassoc (a,(b,c)) = ((a,b),c)
Methods
loop :: a (b, d) (c, d) -> a b c