Skip to content

group

The group() function runs several Either values (or functions returning an Either) and returns the first Left encountered. If all are Right, it aggregates their values into a typed object.

Interactive example

Parameters

  • group: Object where each property is an Either or a function returning an Either.

Return value

  • Right with an object gathering all values when they are all Right.
  • Otherwise the first Left that fails in the order of declaration of the group.

See also

Released under the MIT license.