rescript-core
rescript-core copied to clipboard
Question about process
I'd like to understand the process of ensuring the result here of this "you don't need to reach for anything else for typical ReScript development." Maybe there is a well defined process and I just don't know what it is, so forgive me.
I started using Core in the past week and I've noticed a few big holes. First, I couldn't create an array of 10 items consisting of the numbers 1...10. Previously I'd use Belt.makeBy
. On GitHub I can see these features from Belt were added very recently but aren't in the version I'm using. There are times I get an error result from an external API and I want to convert it to my own version. F# has a Result.mapError
which seems pretty useful. There are times you want to take two options and concat them; in F# this is the map2
function or could be a let concat: (option<'a>, option<'b>, ('a, 'b) => 'c) => option<'c>
. And so I'm curious whether there could be improvements to the design process to ensure we end up with a cohesive package .
I think a good process for array
or any built-in type would be something like this. Look at ALL the functions from similar languages/projects - built-in JS functions, F#, PureScript, fp-ts, OCaml, Haskell, Belt, ramda/lodash. Put them all in a spreadsheet. See where they overlap in function but not necessarily name - maybe a column for each project and a row for each function. Group them into constructors
, mappers
- like from one array to another array, utilities
- those that exit the type like array.length. Mark the ones that seem fundamental and should be included and the ones that are too niche for inclusion. Mark the immutable vs. mutable. Make a proposal for a final set with consistent naming. Publish this spreadsheet somewhere so we can all see it. Get some feedback from community.