| > I'm not sure what you mean by `Person (Compose Maybe Maybe)`? Is that a person with values you have to unwrap twice to use? `Compose Maybe Maybe T` (equivalently `Maybe (Maybe T))`), has N + 2 values (where N in the probably-infinite number of values T has): . N values consisting of a T . 2 different values that do not include a T It's also equivalent (via 1 + (1 + N) = (1 + 1) + N) to `Either Bool T`. And yes, `Person f` contains values of type `f Whatever`. > it either is undefined or isn't. Values are never undefined. They might be defined as a object that's called "undefined", but that is a specific, defined, value. And, apropos of the above, it's a single value, out of the two distinct non-T values being represented. Which is part of why the example at https://news.ycombinator.com/item?id=26277598 looks horrible - it seems like it would confuse the two different non-T values with each other if `Person f` includes a `f (Maybe T)`. Edit: actually, clarified the previous comment a bit, too. |
> Values are never undefined.
I am referring to the JS concept of the singleton `undefined`, not an abstract idea of definedness.
Overall I see where you're coming from, but scrambling Haskell and TypeScript syntax is severely impacting legibility.
End of the day Haskell and TS have very different use cases, one is a research language exploring the reaches of type theory, the other is type system bolted onto a dynamic language doing the best it can. Sure there are some concepts that it can't express, but that's entirely missing the point.