Header menu logo Nu

Modifier Module

Modifier operators.

Functions and values

Function or value Description

arrow f

Full Usage: arrow f

Parameters:
    f : 'a -> 'b

Returns: Modifier<'a, 'b>

Creates an arrow from a function. The arrow takes a behavior as input and applies the function to it.

f : 'a -> 'b
Returns: Modifier<'a, 'b>

compose mdfr mdfr2

Full Usage: compose mdfr mdfr2

Parameters:
Returns: Modifier<'a, 'c>

Composes the given modifier `mdfr` with another modifier `mdfr2`. The `mdfr` is applied first, and then the result is passed as input to `mdfr2`.

mdfr : Modifier<'a, 'b>
mdfr2 : Modifier<'b, 'c>
Returns: Modifier<'a, 'c>

composeFlip mdfr mdfr2

Full Usage: composeFlip mdfr mdfr2

Parameters:
Returns: Modifier<'a, 'c>

Composes the given modifier `mdfr2` with another modifier `mdfr`. The `mdfr2` is applied first, and then the result is passed as input to `mdfr`.

mdfr : Modifier<'b, 'c>
mdfr2 : Modifier<'a, 'b>
Returns: Modifier<'a, 'c>

composeLeft f mdfr

Full Usage: composeLeft f mdfr

Parameters:
Returns: Modifier<'a, 'c>

Composes the given modifier `mdfr` with the provided function `f`. The `mdfr` is applied first, and then the resulting behavior is mapped using `f`.

f : 'b -> 'c
mdfr : Modifier<'a, 'b>
Returns: Modifier<'a, 'c>

composeLeftFlip mdfr f

Full Usage: composeLeftFlip mdfr f

Parameters:
Returns: Modifier<'a, 'c>

Composes the given modifier `mdfr` with the provided function `f`. The `mdfr` is applied first, and then the resulting behavior is mapped using `f`.

mdfr : Modifier<'a, 'b>
f : 'b -> 'c
Returns: Modifier<'a, 'c>

fanOut mdfr mdfr2

Full Usage: fanOut mdfr mdfr2

Parameters:
Returns: Modifier<'a, ('b * 'b2)>

Fan-out composition of two modifiers. It runs both modifiers `mdfr` and `mdfr2` on the same input behavior and produces a pair of results.

mdfr : Modifier<'a, 'b>
mdfr2 : Modifier<'a, 'b2>
Returns: Modifier<'a, ('b * 'b2)>

first mdfr

Full Usage: first mdfr

Parameters:
Returns: Modifier<('a * 'c), ('b * 'c)>

Composes the given modifier `mdfr` with the behavior of a pair of type `'a * 'c`. The `mdfr` is applied to the first component of the pair, while the second component remains unchanged. The output behavior is a pair of type `'b * 'c`, where the first component is the result of applying `mdfr` to the first component of the input pair, and the second component is the unchanged second component of the input pair.

mdfr : Modifier<'a, 'b>
Returns: Modifier<('a * 'c), ('b * 'c)>

lift1 op mdfr

Full Usage: lift1 op mdfr

Parameters:
Returns: Modifier<'a, 'c>

Lifts a unary function to operate on behaviors through a modifier.

op : 'b -> 'c
mdfr : Modifier<'a, 'b>
Returns: Modifier<'a, 'c>

lift2 op mdfr mdfr2

Full Usage: lift2 op mdfr mdfr2

Parameters:
Returns: Modifier<'a, 'd>

Lifts a binary function to operate on behaviors through a modifier.

op : 'b -> 'c -> 'd
mdfr : Modifier<'a, 'b>
mdfr2 : Modifier<'a, 'c>
Returns: Modifier<'a, 'd>

lift3 op mdfr mdfr2 mdfr3

Full Usage: lift3 op mdfr mdfr2 mdfr3

Parameters:
Returns: Modifier<'a, 'e>

Lifts a ternary function to operate on behaviors through a modifier.

op : 'b -> 'c -> 'd -> 'e
mdfr : Modifier<'a, 'b>
mdfr2 : Modifier<'a, 'c>
mdfr3 : Modifier<'a, 'd>
Returns: Modifier<'a, 'e>

lift4 op mdfr mdfr2 mdfr3 mdfr4

Full Usage: lift4 op mdfr mdfr2 mdfr3 mdfr4

Parameters:
Returns: Modifier<'a, 'f>

Lifts a 4-ary function to operate on behaviors through a modifier.

op : 'b -> 'c -> 'd -> 'e -> 'f
mdfr : Modifier<'a, 'b>
mdfr2 : Modifier<'a, 'c>
mdfr3 : Modifier<'a, 'd>
mdfr4 : Modifier<'a, 'e>
Returns: Modifier<'a, 'f>

lift5 op mdfr mdfr2 mdfr3 mdfr4 mdfr5

Full Usage: lift5 op mdfr mdfr2 mdfr3 mdfr4 mdfr5

Parameters:
Returns: Modifier<'a, 'g>

Lifts a 5-ary function to operate on behaviors through a modifier.

op : 'b -> 'c -> 'd -> 'e -> 'f -> 'g
mdfr : Modifier<'a, 'b>
mdfr2 : Modifier<'a, 'c>
mdfr3 : Modifier<'a, 'd>
mdfr4 : Modifier<'a, 'e>
mdfr5 : Modifier<'a, 'f>
Returns: Modifier<'a, 'g>

loop mdfr

Full Usage: loop mdfr

Parameters:
Returns: Modifier<'a, 'b>

Looping behavior. Loops a behavior by tying the knot.

mdfr : Modifier<('a * 'c), ('b * 'c)>
Returns: Modifier<'a, 'b>

map op mdfr

Full Usage: map op mdfr

Parameters:
Returns: Modifier<'a, 'c>

Functor map. Maps a function over a modifier's output behavior.

op : 'b -> 'c
mdfr : Modifier<'a, 'b>
Returns: Modifier<'a, 'c>

returnM bhvr

Full Usage: returnM bhvr

Parameters:
Returns: Modifier<'a, 'a>

Monadic return. Lifts a behavior into a modifier that leaves the behavior unchanged.

bhvr : 'a Behavior
Returns: Modifier<'a, 'a>

run bhvr mdfr

Full Usage: run bhvr mdfr

Parameters:
Returns: 'b Behavior

Run a behavior modifier.

bhvr : 'a Behavior
mdfr : Modifier<'a, 'b>
Returns: 'b Behavior

second mdfr

Full Usage: second mdfr

Parameters:
Returns: Modifier<('c * 'a), ('c * 'b)>

Composes the given modifier `mdfr` with the behavior of a pair of type `'c * 'a`. The `mdfr` is applied to the second component of the pair, while the first component remains unchanged. The output behavior is a pair of type `'c * 'b`, where the first component is the unchanged first component of the input pair, and the second component is the result of applying `mdfr` to the second component of the input pair.

mdfr : Modifier<'a, 'b>
Returns: Modifier<('c * 'a), ('c * 'b)>

split mdfr mdfr2

Full Usage: split mdfr mdfr2

Parameters:
Returns: Modifier<('a * 'a2), ('b * 'b2)>

Splits the input into two behaviors and runs the given modifiers `mdfr` and `mdfr2` on each part independently.

mdfr : Modifier<'a, 'b>
mdfr2 : Modifier<'a2, 'b2>
Returns: Modifier<('a * 'a2), ('b * 'b2)>

Type something to start searching.