Control.Concatenative brings postfix notation in the style of factor (see http:factorcode.org) to haskell. Interfaces using both combinators and arrows are available.
- bi :: (a -> b) -> (a -> c) -> (b -> c -> d) -> a -> d
- tri :: (a -> b) -> (a -> c) -> (a -> d) -> (b -> c -> d -> e) -> a -> e
- biSp :: (a -> c) -> (b -> d) -> (c -> d -> e) -> a -> b -> e
- triSp :: (a -> d) -> (b -> e) -> (c -> f) -> (d -> e -> f -> g) -> a -> b -> c -> g
- biAp :: (t -> t1) -> (t1 -> t1 -> t2) -> t -> t -> t2
- triAp :: (a -> b) -> (b -> b -> b -> c) -> a -> a -> a -> c
- ifte :: (a -> Bool) -> (a -> b) -> (a -> b) -> a -> b
- (>>@) :: Arrow a => a b (x, y) -> (x -> y -> z) -> a b z
- dup :: Arrow a => a b (b, b)
- swap :: Arrow a => a (x, y) (y, x)
- both :: Arrow a => a b c -> a (b, b) (c, c)
- (>>>) :: Category cat => cat a b -> cat b c -> cat a c
- (&&&) :: Arrow a => forall b c c'. a b c -> a b c' -> a b (c, c')
- (***) :: Arrow a => forall b c b' c'. a b c -> a b' c' -> a (b, b') (c, 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)
Postfix combinators
bi :: (a -> b) -> (a -> c) -> (b -> c -> d) -> a -> dSource
Apply both arguments to a and combine the results
tri :: (a -> b) -> (a -> c) -> (a -> d) -> (b -> c -> d -> e) -> a -> eSource
Apply each of three arguments to a and combine the results
biSp :: (a -> c) -> (b -> d) -> (c -> d -> e) -> a -> b -> eSource
Apply the first argument to a, the second to b, and combine the results
triSp :: (a -> d) -> (b -> e) -> (c -> f) -> (d -> e -> f -> g) -> a -> b -> c -> gSource
Apply the first argument to a, the second to b, and the third to c, combining the results
biAp :: (t -> t1) -> (t1 -> t1 -> t2) -> t -> t -> t2Source
Apply a function to two values and combine the results
triAp :: (a -> b) -> (b -> b -> b -> c) -> a -> a -> a -> cSource
Apply a function to three values and combine the results
:: (a -> Bool) | A predicate |
-> (a -> b) | Applied if the predicate yields True |
-> (a -> b) | Applied if the predicate yields False |
-> a | |
-> b |
Postfix arrows
(&&&) :: 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.
(***) :: 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.