mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
🤖 Merge PR #47648 [sanctuary] Added fromLeft and fromRight definitions for Either by @bratter
* [sanctuary] Add fromLeft and fromRight definitions for Either * [sanctuary] Added fromLeft and fromRight tests; refactored type expectations for others * [sanctuary] fixed failing tests
This commit is contained in:
parent
194ca3834a
commit
3500e0062b
2
types/sanctuary/index.d.ts
vendored
2
types/sanctuary/index.d.ts
vendored
@ -222,6 +222,8 @@ declare namespace Sanctuary {
|
||||
// Either
|
||||
isLeft(p: Either<any, any>): boolean;
|
||||
isRight(p: Either<any, any>): boolean;
|
||||
fromLeft<A>(p: A): (q: Either<A, any>) => A;
|
||||
fromRight<B>(p: B): (q: Either<any, B>) => B;
|
||||
fromEither<B>(p: B): (q: Either<any, B>) => B;
|
||||
either<A, C>(p: Fn<A, C>): <B>(q: Fn<B, C>) => (r: Either<A, B>) => C;
|
||||
lefts<A>(p: ReadonlyArray<Either<A, any>>): A[];
|
||||
|
||||
@ -62,3 +62,9 @@ S.intercalate(', ')([]);
|
||||
|
||||
// $ExpectType number[]
|
||||
S.intercalate([0, 0, 0])([[1], [2, 3], [4, 5, 6], [7, 8], [9]]);
|
||||
|
||||
// $ExpectType number
|
||||
S.fromLeft(1)(S.Right('a'));
|
||||
|
||||
// $ExpectType number
|
||||
S.fromRight(1)(S.Left('a'));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user