
21 Feb
2024
21 Feb
'24
4:17 a.m.
Dear Cafe, I was surprised to see ghc accept this code ghci> do let {x = False}; not x True because I initially thought: there's a `do`, so there must be some monad, but which is it? some implicit Identity monad perhaps? But the type is indeed plain `Bool`, and the explanation is (I think): there is a `do` but there is no monad, since the translation according to ( https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-470003.1... ) does never produce `(>>=)`. So, all is fine, nothing to see here. Perhaps keep in mind as an edge case, useful to confuse students. Actually, to motivate them to read the language standard ... - J.W.