I can't remember how I chose the name.
It's just the bare bones of FP.
- Either
- types:
Either,Left,Right - constructors:
left,right - type guards:
isLeft,isRight toEither: the[right, left]tuple, for use with promises (promise.then(...toEither))
- types:
- Option
- types:
Option,Some,None - constructors:
some,none - type guards:
isSome,isNone - singleton:
NONE
- types:
- Error
toError: if something is not anError, then wrap it in one- type
ErrnoException— likeNodeJS.ErrnoException, but with stronger typing of.code isErrnoException: type guard forErrnoException
- Throw
doThrow:throw, but as a functiondoTryCatch: run a function, then turn its return value / thrown error into anEither
Imports can be done via @blaahaj/gotcha (for everything) or @blaahaj/gotcha/Either, etc.