charmonium | 1 year ago | on: Stagex – Container-native, full-source bootstrapped, and reproducible toolchain
charmonium's comments
charmonium | 2 years ago | on: Template Strings Make the Wrong Thing Easier
One must consider the cost of developing/maintaining new language parsing infrastructure (main point of the blog) against the readability/conciseness/features of a new syntax (not discussed in the blog).
charmonium | 5 years ago | on: Stop Writing Shell Scripts
charmonium | 6 years ago | on: Monads as a Programming Pattern
charmonium | 6 years ago | on: Monads as a Programming Pattern
We can have arbitrarily nested monads:
monadicObj.bind((T value) => monad.wrap(monad.wrap(value)));
Remember, `bind` only unwraps one layer. Without it unwrapping one layer, programs would continue accumulating large stacks of monads in monads.I would also point out that it only collapses abstractions of the same kind; Maybe's bind only unwraps one layer of Maybe's. If you have a Promise<Maybe<Foo>> where Foo contains potentially more monads as instance-variables, those don't all get collapsed.
I like the 'converting nesting to concatenating' observation.
Sometimes we do need parentheses though, because most languages are not associative 5 - 2 - 1 is not the same as 5 - (2 - 1). Basically minus does not form a monoid, so the parens matter.
charmonium | 6 years ago | on: Monads as a Programming Pattern
An object wrapper has to have the object somewhere in memory, you just can't touch it. With a monad, the object might not even exist yet (example: Promise) or there might be more than one (example: Collections).
charmonium | 6 years ago | on: Monads as a Programming Pattern
charmonium | 9 years ago | on: Stepping into math: Open-sourcing our step-by-step solver
charmonium | 9 years ago | on: Stepping into math: Open-sourcing our step-by-step solver
charmonium | 9 years ago | on: Stepping into math: Open-sourcing our step-by-step solver