bind: The 'bind' operator

Description Usage Arguments Details

Description

%>>=% (pronounced "bind") is a generic operator intended to match the semantics of >>= in other functional programming languages, such as F# or Haskell. It is intended that the right-hand side will contain a function or block, similar to the pipe operator %>%. Bind is usually employed to apply functions to the contents of possibly-opaque "container" objects. See bind-result or bind-list for examples.

Usage

1
2
3
4
lhs %>>=% rhs

## Default S3 method:
lhs %>>=% rhs

Arguments

lhs

The left-hand side of the operator.

rhs

Although not required, it is intended that the right-hand side contain a function or block, evaluated with . bound to the value of lhs.

Details

By default, it will simply pipe the left-hand side into the function or block on the right-hand side, as with %>%, although this is not recommended – any S3 classes with a "bind" implementation of their own might yield very different results than the default behaviour.


atheriel/rrails documentation built on May 4, 2019, 1:07 p.m.