Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Fail m a = Fail String
- runFail :: Sem (Fail ': r) a -> Sem r (Either String a)
- failToError :: Member (Error e) r => (String -> e) -> Sem (Fail ': r) a -> Sem r a
- failToNonDet :: Member NonDet r => Sem (Fail ': r) a -> Sem r a
- failToEmbed :: forall m r a. (Member (Embed m) r, MonadFail m) => Sem (Fail ': r) a -> Sem r a
Effect
This effect abstracts the concept of MonadFail
,
which is a built-in mechanism that converts pattern matching errors to
calls to the current monad's instance of that class.
The instance defined in Polysemy.Internal uses this effect to catch those errors.