package bonsai
A library for building dynamic webapps, using Js_of_ocaml
Install
Dune Dependency
Authors
Maintainers
Sources
bonsai-v0.14.0.tar.gz
sha256=43f35d648644492d776bf2c7b86c8227e7793615b6a658432e95f8dccd3631f8
md5=b5e743dbfa64d0da5fd660f14cd0b549
doc/bonsai.web/Bonsai_web/Bonsai/Arrow/index.html
Module Bonsai.Arrow
('i, _, 'r) t
is an arrow from 'i
to 'r
.
val arr : ('input -> 'result) -> ('input, 'result) t
arr
is the same as pure
.
first t
applies t
to the first part of the input.
.-----------------------. | .-------------------. | .-- 'input --+-| 'input -> 'result |-+-- 'result --. / | `-------------------` | \ 'input * 'a --+---------'a --+-----------------------+-- 'a ---------+-- 'result * 'a `-----------------------`
second t
applies t
to the second part of the input.
.-----------------------. .----- 'a --+-----------------------+-- 'a -----. / | .-------------------. | \ 'a * 'input --+--- 'input --+-| 'input -> 'result |-+-- 'result --+-- 'a * 'result | `-------------------` | `-----------------------`
split t u
applies t
to the first part of the input and u
to the second part.
.-----------------. | .-------------. | .-- 'i1 --+-| 'i1 -> 'r1 |-+-- 'r1 --. / | `-------------` | \ / | .-------------. | \ 'i1 * 'i2 --+----- 'i2 --+-| 'i2 -> 'r2 |-+-- 'r2 -----+-- 'r1 * 'r2 | `-------------` | `-----------------`
extend_first
returns the result of a bonsai component alongside its input.
.----------------------------. | .-------------------. | 'input --+-+----| 'input -> 'result |-+-- 'result --. | \ `-------------------` | \ | `------------------------+-- 'input -----+-- 'result * 'input `----------------------------`
extend_second
returns the result of a bonsai component alongside its input.
.----------------------------. | .------------------------+-- 'input --. | / .-------------------. | \ 'input --+-+----| 'input -> 'result |-+-- 'result ---+-- 'input * 'result | `-------------------` | `----------------------------`
fanout t u
applies t
and u
to the same input and returns both results. It's actually just both
.
.------------------------. | .---------------. | | .--| 'input -> 'r1 |-+-- 'r1 --. | / `---------------` | \ 'input --+-+ | \ | \ .---------------. | \ | `--| 'input -> 'r2 |-+-- 'r2 ------+-- 'r1 * 'r2 | `---------------` | `------------------------`
^>>
is the same as @>>
, but with a Haskell-like name.
>>^
is the same as >>|
, but with a Haskell-like name.
val partial_compose_first :
('input, 'shared * 'output1) t ->
('input * 'shared, 'output2) t ->
('input, 'output1 * 'output2) t
Composes two components where one of the outputs of the first component is one of the inputs to the second.
.--------------------------------------------. | .------------------------------. | | .--| 'input -> 'shared * 'output1 |--+--+-- 'output1 --. | / `------------------------------` | | \ | / | | \ 'input --|-+ .---------- 'shared --------------` | \ | \ | | \ | \ | .------------------------------. | \ | `--+--| 'input * 'shared -> 'output2 |--+-- 'output2 --------+-- 'output1 * 'output2 | `------------------------------` | `--------------------------------------------`
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>