Foldable

public protocol Foldable

Undocumented

  • Undocumented

    Declaration

    Swift

    static func foldLeft<A, B>(_ fa: Kind<Self, A>, _ b: B, _ f: @escaping (B, A) -> B) -> B
  • Undocumented

    Declaration

    Swift

    static func foldRight<A, B>(_ fa: Kind<Self, A>, _ b: Eval<B>, _ f: @escaping (A, Eval<B>) -> Eval<B>) -> Eval<B>
  • fold(_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func fold<A>(_ fa: Kind<Self, A>) -> A where A : Monoid
  • reduceLeftToOption(_:_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func reduceLeftToOption<A, B>(_ fa: Kind<Self, A>, _ f: @escaping (A) -> B, _ g: @escaping (B, A) -> B) -> Option<B>
  • reduceRightToOption(_:_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func reduceRightToOption<A, B>(_ fa: Kind<Self, A>, _ f: @escaping (A) -> B, _ g: @escaping (A, Eval<B>) -> Eval<B>) -> Eval<Option<B>>
  • reduceLeftOption(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func reduceLeftOption<A>(_ fa: Kind<Self, A>, _ f: @escaping (A, A) -> A) -> Option<A>
  • reduceRightOption(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func reduceRightOption<A>(_ fa: Kind<Self, A>, _ f: @escaping (A, Eval<A>) -> Eval<A>) -> Eval<Option<A>>
  • combineAll(_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func combineAll<A>(_ fa: Kind<Self, A>) -> A where A : Monoid
  • foldMap(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func foldMap<A, B: Monoid>(_ fa: Kind<Self, A>, _ f: @escaping (A) -> B) -> B
  • traverse_(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func traverse_<G: Applicative, A, B>(_ fa: Kind<Self, A>, _ f: @escaping (A) -> Kind<G, B>) -> Kind<G, Unit>
  • sequence_(_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func sequence_<G, A>(_ fga: Kind<Self, Kind<G, A>>) -> Kind<G, Unit> where G : Applicative
  • find(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func find<A>(_ fa: Kind<Self, A>, _ f: @escaping (A) -> Bool) -> Option<A>
  • exists(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func exists<A>(_ fa: Kind<Self, A>, _ predicate: @escaping (A) -> Bool) -> Bool
  • forall(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func forall<A>(_ fa: Kind<Self, A>, _ predicate: @escaping (A) -> Bool) -> Bool
  • isEmpty(_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func isEmpty<A>(_ fa: Kind<Self, A>) -> Bool
  • nonEmpty(_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func nonEmpty<A>(_ fa: Kind<Self, A>) -> Bool
  • foldM(_:_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func foldM<G: Monad, A, B>(_ fa: Kind<Self, A>, _ b: B, _ f: @escaping (B, A) -> Kind<G, B>) -> Kind<G, B>
  • foldMapM(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func foldMapM<G: Monad, A, B: Monoid>(_ fa: Kind<Self, A>, _ f: @escaping (A) -> Kind<G, B>) -> Kind<G, B>
  • get(_:_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func get<A>(_ fa: Kind<Self, A>, _ index: Int64) -> Option<A>
  • count(_:) Extension method

    Undocumented

    Declaration

    Swift

    public static func count<A>(_ fa: Kind<Self, A>) -> Int64 where A : Monoid