úÎ!!Ê d     8Yet another error monad but for people who are not crazy(c) Erick Gonzalez, 2019BSD3erick@codemonkeylabs.deSafe&'ÑfailableThe © class. A Monad which is an instance of this class can be used as a context in a function running in one with this class constraint, in order to report error conditionsfailable§trigger a failure. It takes an exception value as argument and it returns whatever might be used to abort a monadic computation in the monad instantiating this class.failable9recover from a possible failure. Basically a generalized catch for a Failable.failablePromote a   into a Q context. Useful to reduce boilerplate when using functions that might return a   type. If the value is Nothing0, the error specified is then triggered in the  contextfailablePromote an  value into a J context. Useful to reduce verbosity when using functions that return an  type. If the value is Left erro, the wrapped error is then passed as an argument to the provided function which should return an instance of . so for example: Ÿdata MyErrors = BadValue deriving (Typeable, Show) instance Exception MyErrors foo :: (Failable m) => String -> m Int foo = hoistEither BadValue . readEither  »> foo "5" :: Maybe IntJust 5&»> foo "5" :: Either SomeException IntRight 5'»> foo "X5" :: Either SomeException Int(Left (BadValue "Prelude.read: no parse")»> foo "5" :: Maybe IntJust 5»> foo "X5" :: Maybe IntNothingfailable!Perform a set of IO actions in a   instance, triggering a † upon an IO exception, instead of blindly triggering an asynchronos exception. This serves ultimately to unify error handling in the  context. For example: qfoo :: (Failable m, MonadIO m) => m () foo = do failableIO $ do txt <- readFile "foo.txt" putStrLn txt »> runExceptT fooBLeft foo.txt: openFile: does not exist (No such file or directory)»> runMaybeT fooNothing»> fooL*** Exception: foo.txt: openFile: does not exist (No such file or directory)Safe ?      !&failable-1.0.0.0-EKWfVxwJdDk2z0EQUW1CUControl.Monad.FailablePaths_failableFailablefailurerecover hoistMaybe hoistEither failableIO $fException()$fFailableExceptT$fFailableMaybeT$fFailableEither$fFailableMaybe $fFailable[] $fFailableIObase GHC.MaybeMaybe Data.EitherEitherGHC.Exception.Type ExceptionControl.Monad.IO.ClassMonadIOversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileName