| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
RON.Error
Synopsis
- data Error = Error Text [Error]
- type MonadE = MonadError Error
- correct :: MonadError e m => a -> m a -> m a
- errorContext :: MonadE m => Text -> m a -> m a
- liftEither :: MonadError e m => Either e a -> m a
- liftEitherString :: (MonadError e m, IsString e) => Either String a -> m a
- liftMaybe :: MonadE m => Text -> Maybe a -> m a
- throwErrorString :: (MonadError e m, IsString e) => String -> m a
- throwErrorText :: MonadE m => Text -> m a
Documentation
Instances
| Eq Error Source # | |
| Show Error Source # | |
| IsString Error Source # | |
Defined in RON.Error Methods fromString :: String -> Error # | |
| Exception Error Source # | |
Defined in RON.Error Methods toException :: Error -> SomeException # fromException :: SomeException -> Maybe Error # displayException :: Error -> String # | |
type MonadE = MonadError Error Source #
correct :: MonadError e m => a -> m a -> m a Source #
errorContext :: MonadE m => Text -> m a -> m a Source #
liftEither :: MonadError e m => Either e a -> m a #
Lifts an into any Either e.MonadError e
do { val <- liftEither =<< action1; action2 }where action1 returns an Either to represent errors.
Since: mtl-2.2.2
liftEitherString :: (MonadError e m, IsString e) => Either String a -> m a Source #
throwErrorString :: (MonadError e m, IsString e) => String -> m a Source #
throwErrorText :: MonadE m => Text -> m a Source #