Given your corrected definition, if I try to determine and then use x , I get the expected exception at runtime:
λ> let x = pure 5 >>= pure :: X Int Int λ> runX x 5 5 *** Exception: foo.hs:12:10-20: No instance nor default method for class operation GHC.Base.>>=
There are two possible reasons why you will not see this.
First of all, you just started let , but you never tried to evaluate the result. Since Haskell is lazy, let x = ... actually does nothing. x will only be evaluated when you are actually trying to use it (using, i.e. runX ), so when you click on the error.
Another possibility is that you used let without specifying a type:
λ> let x = pure 5 >>= pure λ> x 5
Here x is polymorphic in the monad m , which he uses. To print something useful for polymorphic terms like this, ghci defaults to m to IO , which works correctly and gives you 5 , but doesn't tell you anything useful about your custom monad.
source share