4 ms·
I was half expecting by the end that the punchline of WCIYF was going to be either IO (the Haskell data type) or Java's checked exceptions, the latter of which
by johnday 5y ago
I was half expecting by the end that the punchline of WCIYF was going to be either IO (the Haskell data type) or Java's checked exceptions, the latter of which is mentioned in WCIYM.
Before we get to the end of WCIYF, we could freely substitute in async (promises); the possibility of exceptions (Java-style checked exceptions in particular); outside-world interactions (Haskell IO); or anything else.
Of course, what we experience in Haskell and other strongly-typed functional languages is that we colour our functions all the time! Not just red and blue; but sometimes green, or yellow, or a combination of several colours at once!
Why is it so ergonomic in a language designed around this concept? What we see in JavaScript is that having the colours (effectively, the monadic wrappers) isn't enough. We also need tools for abstracting and generalising these notions, so that composition goes from being a syntactic disaster to a semantic convenience.
- dllthomas 5y ago> We also need tools for abstracting and generalising these notions, so that composition goes from being a syntactic disaster to a semantic convenience. I've been speculating for a while that the problem with Java's checked exceptions was principally the impoverished language we had to talk about them. If we could write things like "this throws anything the argument throws, except XYZ" things... might've turned out considerably differently.