No matching definitions.

tur/arrow

stdlib/arrow.tur

Haskell-style Arrow typeclass hierarchy for signal processing.

Since: Phase CA0

defn

arr

(arr [f])

lift a function to an arrow (identity for function arrows).

fthe function to lift

The function itself.

(arr (fn [x] (+ x 1)))  ; => identity for functions
defn

>>>

(>>> [f g])

compose two function arrows sequentially.

ffirst arrow (a -> b)
gsecond arrow (b -> c)

A function (a -> c) that applies f then g.

((>>> (fn [x] (+ x 1)) (fn [x] (* x 2))) 3)  ; => 8
defn

arrow-first

(arrow-first [f])

apply a function to the first component of a Tuple2.

ffunction to apply

A function on Tuple2 that applies f to the first field.

((arrow-first (fn [x] (+ x 1))) <heap Tuple2 (5, 10)>)  ; => Tuple2(6, 10)
defn

arrow-second

(arrow-second [f])

apply a function to the second component of a Tuple2.

ffunction to apply

A function on Tuple2 that applies f to the second field.

((arrow-second (fn [x] (+ x 1))) <heap Tuple2 (5, 10)>)  ; => Tuple2(5, 11)
defn

par-comp

(par-comp [a b c d f g])

parallel composition of two functions on Tuple2 types.

ffunction a -> b
gfunction c -> d

A function on Tuple2 a c -> Tuple2 b d: (par-comp f g)(tuple2 x y) = tuple2(f x, g y).

((par-comp inc double) (tuple2 1 2))  ; => Tuple2(2, 4)
defn

arrow-split

(arrow-split [a b c f g])

duplicate input and apply two functions, returning a Tuple2.

ffunction a -> b
gfunction a -> c

A function a -> Tuple2 b c: (arrow-split f g)(x) = tuple2(f x, g x).

((arrow-split inc double) 3)  ; => Tuple2(4, 6)
defn

arrow-const

(arrow-const [v])

arrow that ignores its input and always returns v.

vthe constant value to return

An arrow (any -> v).

((arrow-const 42) 999)  ; => 42

Since: Phase B2

defn

arrow-dup

(arrow-dup [x] :int)

arrow that duplicates its input into a Tuple2.

xthe value to duplicate

A Tuple2 of x with itself: Tuple2(x, x).

(tuple2-1st (arrow-dup 7))  ; => 7

Since: Phase B2

Internal definitions
__arrow_call1-- call a function stored as int64 with one argument.
__arrow_call2-- call a function stored as int64 with two arguments.
__arrow_pair_first-- inline-C: apply fv to e1 of a heap Tuple2 *p,
__arrow_pair_second-- inline-C: apply fv to e2 of a heap Tuple2 *p,
__arrow_pair_par-- inline-C: apply fv to e1 and gv to e2 of *p.
__arrow_pair_split-- inline-C: produce a heap Tuple2 from (fv x, gv x).
__arrow_pair_dup-- inline-C: produce a heap Tuple2 with both fields = x.