Hi Daryoush,
loop = MonadPlus m => m Boolloop = loopIf we apply Just to loop as followstest2 :: MonadPlus m => m (Maybe Bool)test2 = loop >>= return . Justthe evaluation of test2 does not terminate because >>= has to evaluate loop. But this does not correctly reflect the behaviour in a functional logic language like Curry. For example, if you have a function that checks whether the outermost constructor of test2 is Just, the test is supposed to be successful. In the naive model for non-determinism this is not the case.
Do I have to have MonadPlus m or would any other Monad class work the same way?