Fp-ts: Either<L, A>#equals should accept a Setoid<L> other than a Setoid<A>

Created on 8 Oct 2017  路  6Comments  路  Source: gcanti/fp-ts

bug

All 6 comments

Setoid of L has to be tested against the Left side I guess? How to match the types then ?

The signature should be

export const equals = <L, A>(SL: Setoid<L>, SA: Setoid<A>) => (fx: Either<L, A>) => (fy: Either<L, A>): boolean

like in These https://github.com/gcanti/fp-ts/blob/6cdc0115c95f16926330a795f48aa76f605dc638/src/These.ts#L182

The same for Validation.

@gcanti does class Both<L, A> also needed?

Fyi this is my branch: https://github.com/gcanti/fp-ts/compare/master...rilut:fix/either-equals. I'll figure out chainRec and partitionMap

does class Both also needed?

@rilut No, Both is from These. Either is just the coproduct of Left and Right.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miguelferraro picture miguelferraro  路  3Comments

amaurymartiny picture amaurymartiny  路  4Comments

bobaaaaa picture bobaaaaa  路  4Comments

Crashthatch picture Crashthatch  路  4Comments

mattgrande picture mattgrande  路  3Comments