Would you be interesting in updating the library to use MonadFail instead of Maybe to denote error conditions in decodeText? We can specialize it (through the SPECIALIZE pragma) to Maybe, but it also opens up a whole world of other use cases and call sites.
The catch with this suggestion is that MonadFail is being rolled out rather slowly...with effectively full adoption not coming into play until GHC 8.8 as per https://wiki.haskell.org/MonadFail_Proposal -- but the support in Maybe has been there since base 4.9.0.0 as per https://hackage.haskell.org/package/base-4.11.0.0/docs/Control-Monad-Fail.html#t:MonadFail so for backwards compatibility, we could define the MonadFail instance as an {-# OVERLAPPABLE #-} instance (so as to not conflict with the Monad instance) and conditionally included based on the CPP #if MIN_VERSION_base(4,9,0).
If you're open to this change, I'm happy to submit the pull request.
Would you be interesting in updating the library to use
MonadFailinstead ofMaybeto denote error conditions indecodeText? We can specialize it (through theSPECIALIZEpragma) toMaybe, but it also opens up a whole world of other use cases and call sites.The catch with this suggestion is that
MonadFailis being rolled out rather slowly...with effectively full adoption not coming into play until GHC 8.8 as per https://wiki.haskell.org/MonadFail_Proposal -- but the support inMaybehas been there sincebase 4.9.0.0as per https://hackage.haskell.org/package/base-4.11.0.0/docs/Control-Monad-Fail.html#t:MonadFail so for backwards compatibility, we could define theMonadFailinstance as an{-# OVERLAPPABLE #-}instance (so as to not conflict with theMonadinstance) and conditionally included based on the CPP#if MIN_VERSION_base(4,9,0).If you're open to this change, I'm happy to submit the pull request.