errorful parser

small
This commit is contained in:
crumbtoo
2024-01-22 09:59:48 -07:00
parent 5a659d22dd
commit c146e1c450
3 changed files with 10 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ data MsgEnvelope e = MsgEnvelope
, _msgDiagnostic :: e
, _msgSeverity :: Severity
}
deriving Functor
newtype RlpcError = Text [Text]
deriving Show
@@ -55,3 +56,6 @@ liftRlpcErrors :: (Functor m, IsRlpcError e)
-> ErrorfulT RlpcError m a
liftRlpcErrors = mapErrorful liftRlpcError
instance (IsRlpcError e) => IsRlpcError (MsgEnvelope e) where
liftRlpcError msg = msg ^. msgDiagnostic & liftRlpcError