Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function prop<T, K extends keyof T>(name: K, o: T): T[K] {
- return o[name];
- }
- function maybeProp<T, K extends keyof T>(name: K, o: T): Option<T[K]> {
- return fromNullable(o[name]);
- }
- const safeProp = R.curry(maybeProp);
- const pipeK = R.pipeK;
- function distribute<T>(os: Option<T[]>): Array<Option<T>> {
- return R.sequence(R.of, os);
- }
Add Comment
Please, Sign In to add comment