-
-
Save qwo/706834d355da09ebbd3a225b285c4e4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare namespace F { | |
| class Either<A, B> { | |
| private constructor(); | |
| // Hack to make A and B covariant. | |
| private a: A; | |
| private b: B; | |
| static Left<A, B>(a: A): Either<A, B>; | |
| static Right<A, B>(b: B): Either<A, B>; | |
| static either<A, B, C>(f: (a: A) => C, g: (b: B) => C, e: Either<A, B>): C; | |
| static of<A, B>(b: B): Either<A, B>; | |
| static isLeft<A, B>(e: Either<A, B>): boolean; | |
| static isRight<A, B>(e: Either<A, B>): boolean; | |
| map<C>(f: (b: B) => C): Either<A, C>; | |
| chain<C>(f: (b: B) => Either<A, C>): Either<A, C>; | |
| bimap<C, D>(f: (a: A) => C, g: (b: B) => D): Either<C, D>; | |
| equals(e: Either<A, B>): boolean; | |
| } | |
| } | |
| declare module 'ramda-fantasy' { | |
| export = F; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment