tolysz / possible

Three valued Data.Maybe
Other
4 stars 1 forks source link

inconsistency between (>>) and (>>=) #1

Open ghost opened 9 years ago

ghost commented 9 years ago

given the Monad instance for Possible, the following fails to hold:

MissingData >> b = MissingData >>= \_ -> b

while this is not a law per se, it is generally expected that

a >> b = a >>= \_ -> b
tolysz commented 9 years ago

Thank you :) I was writing the cases in hope Possible can be made a monad. I will change to have:

MissingData  >>= _  = MissingData
MissingData  >>  _  = MissingData

But there are many ways to make 3VL (three valued logic) I was struggling to make aeson use it :) and was made a separate package just to be able fix stuff like that later