News for hackers. Stuff that matters.
Re:Why nullable types? by jerf on Tuesday December 08, 2020 @10:57PM (#25355163)
In a language with Haskell's guarantees, you can mechanically get from the standard "bind" function to prove that "m (m a)" can be converted to "m a" [1]. That function is called "join", and is a lesser-well known way to write monad implementations which is equivalent to the more famous bind function.

(IMHO, join is a better way to understand the typeclass intuitively. The standard bind is better to program with in general use, but much harder to grok.)

So, in Haskell, it's more than just "the APIs would tend to encourage not nesting the types"... having a valid monad implementation means they really are equivalent.

[1]: https://stackoverflow.com/questions/3382210/monad-join-funct...

Re:Why nullable types? by dllthomas on Wednesday December 09, 2020 @12:46AM (#25355734)
They are not equivalent. Join can throw away information - and certainly does for (Maybe (Maybe a) -> Maybe a) and ([[a]] -> [a]).

They would be equivalent if there was an isomorphism, but of course there isn't.