I don’t really get how to set things up, nothing seems obvious.
-
what do I do when my lib uses modules internally that are not to be exposed? for example, I might have a library that has bindings for “chalk” because it does logging, but it should not “re-export” chalk. right now, anyone who uses the library cannot have a module named chalk in their code. how is this to be handled in real-world projects?
-
is it ok to use RescriptCore in libraries? I’m getting duplicated package log messages all over.
-
my code started doing REALLY weird stuff after dividing it into packages.
for example, Result.Map just stopped working:
...
Console.log(r) // logs { TAG: 'Ok', _0: [Function (anonymous)] }
let x = r->Result.map(x => {
Console.log(x)
1234
}) // doesnt log
Console.log(x) // logs { TAG: 'Ok', _0: [Function (anonymous)] }
looking inside Core__Result.mjs:
function map(opt, f) {
if (opt.TAG === /* Ok */0) {
return {
TAG: /* Ok */0,
_0: Curry._1(f, opt._0)
};
} else {
return opt;
}
}
so it’s not looking for “Ok”, it’s looking for 0. what?
this is rescript 11 rc8