Closed paldepind closed 6 years ago
I guess I better rename then
to chain
too, then?
then
is problematic because then
is part of the promise specification but Tree
isn't a promise. Currently, if you happened to use the rose tree with promises
somePromis.then((result) => Tree.of(result));
then you'd get an error because native promises assume that everything with a then
method is Promise-like. So it's best not to add a then
method things that aren't promises.
On the other hand chain
isn't completely appropriate either because the depth
argument is passed along which, strictly speaking, isn't the correct signature for a chain
method. chainWithDepth
would be appropriate but it's quite verbose. I honestly don't know what is best.
I renamed them to chain
now and removed the depth argument (it felt a bit out of place and didn't count the number of shrinks correctly anyway)
It is customary to call
pure
forof
in TypeScript/JavaScript. This is a precedence set by Fantasy Land.This PR renames
pure
toof
. It also adds a simple.gitignore
to excludenode_modules
and the compiled files.