/** * Get `Witherable`'s `compactF` for an `Either` given an * `AssociativeIdentity`. * * @tsplus static Either.Ops getCompactF */ export function getCompactF(M: AssociativeIdentity): Wither> { const compact = Either.$.compactMaybe(M) return HKT.instance( (G: Applicative) => (f: (a: A) => HKT.Kind>) => (either: Either) => { const traverseF = Either.forEachF(G) return G.map((e: Either>) => compact(e))(traverseF(f)(either)) } ) }