rescript-lang / rescript-compiler

The compiler for ReScript.
https://rescript-lang.org
Other
6.71k stars 446 forks source link

Either in Belt #2611

Closed mchaver closed 3 years ago

mchaver commented 6 years ago

If I made a PR for Belt to add support for an Either type and related functions, is that something you would consider merging, or is there some sort of guidelines for the sort of things you would support in Belt?

bobzhang commented 6 years ago

hi @mchaver , thanks for your interest. we would like to have belt.Option first

chenglou commented 6 years ago

@mchaver to mirror the Result type on native side?

mchaver commented 6 years ago

@bobzhang, @chenglou Thanks. Yes to mirror the result type. It could be called result as well, that doesn't really matter. In some of my own packages I define functions like catSomes and arrayCatSomes to get all of the Some values from a list/array of Options, and things like rights, lefts, isLeft, isRight, map, bimap, fold, etc. for either/result. Ideally this very generic container functions would live in the stdlib. Tomorrow I'll try to put together a PR for Belt and request feedback from you guys.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.