← Back



interface Separated<A, B> {
  readonly left: A
  readonly right: B

Added in v1.7.0 (interface)

A Separated type which holds left and right parts.


interface Compactable<F> {
  readonly URI: F
   * Compacts a data structure unwrapping inner Option
  readonly compact: <A>(fa: HKT<F, Option<A>>) => HKT<F, A>
   * Separates a data structure moving inner Left to the left side and inner Right to the right side of Separated
  readonly separate: <A, B>(fa: HKT<F, Either<A, B>>) => Separated<HKT<F, A>, HKT<F, B>>

Added in v1.7.0 (type class)

Compactable represents data structures which can be compacted/filtered. This is a generalization of catOptions as a new function compact. compact has relations with Functor, Applicative, Monad, Plus, and Traversable in that we can use these classes to provide the ability to operate on a data type by eliminating intermediate Nones. This is useful for representing the filtering out of values, or failure.


getCompactableComposition<F, G>(
  F: Functor<F>,
  G: Compactable<G> & Functor<G>
): CompactableComposition<F, G>

Added in v1.12.0 (function)