I was trying to update some old code which was still using the msgpack package, so I tried switching to this fork. I see the MessagePack class now has
fromObject :: (Applicative m, Monad m) => Object -> m a
instead of
fromObject :: Object -> Maybe a
Can you explain the rationale for this change? I see no reason why fromObject needs to work polymorphically over all monads, it has nothing to do with monads at all! You end up using just the fail method for all your instances. At best, you could change Maybe a to Either Error a using an Error datatype.
I was trying to update some old code which was still using the
msgpackpackage, so I tried switching to this fork. I see theMessagePackclass now hasinstead of
Can you explain the rationale for this change? I see no reason why
fromObjectneeds to work polymorphically over all monads, it has nothing to do with monads at all! You end up using just thefailmethod for all your instances. At best, you could changeMaybe atoEither Error ausing anErrordatatype.