Could you explain me why following code returns Nothing insteaf od exception "zero" ?
Just 0 >>= (\ x -> if (x == 0) then fail "zero" else Just (x + 1) )
Because you are using the Maybe instance of Monad. This instance defines fail as Nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With