pipe (property)

pipe: PipeInClassFn<T> = ...

Applies passed function to this instance and returns function result. Also known as a reverse function application, |> (Reason/ReScript, F#, OCaml), & (Haskell), # (PureScript) or a pipe operator.

Example

some(1).pipe(x => x.isEmpty) // false
none.pipe(x => x.isEmpty) // true

Supports multiple functions.

Example

opt(1).pipe( // Some(1)
x => x.isEmpty, // false
x => !x, // true
) // true

See

pipe

Param

Functions in call chain


Back to index