effin-0.3.0.3: A Typeable-free implementation of extensible effects

Safe HaskellNone
LanguageHaskell2010

Control.Effect.Exception

Contents

Synopsis

Documentation

class (EffectBracket s l, MemberEffect Exception (Exception s e) l) => EffectException s e l Source #

Instances

(EffectBracket s l, MemberEffect (* -> * -> * -> *) Exception (Exception s e) l) => EffectException s e l Source # 

data Exception s e a Source #

An effect that describes the possibility of failure.

Instances

type Is (* -> * -> * -> *) Exception f Source # 
type Is (* -> * -> * -> *) Exception f

runException :: (EffectBracket s l, Show e) => Effect (Exception s e :+ l) a -> Effect l (Either e a) Source #

Completely handles an exception effect.

raise :: EffectException s e l => e -> Effect l a Source #

Raises an exception.

except :: EffectException s e l => Effect l a -> (e -> Effect l a) -> Effect l a Source #

Handles an exception. Intended to be used in infix form.

myComputation `except` \ex -> doSomethingWith ex

Orphan instances

(EffectBracket s l, Member (* -> *) (Exception s e) l, (~) (* -> *) (Exception s e) (InstanceOf (* -> * -> * -> *) Exception l)) => MonadError e (Effect l) Source # 

Methods

throwError :: e -> Effect l a #

catchError :: Effect l a -> (e -> Effect l a) -> Effect l a #