mirror of
https://github.com/polysemy-research/polysemy.git
synced 2024-11-23 09:15:22 +03:00
inline error actions
This commit is contained in:
parent
c059127810
commit
e1061999a1
@ -40,6 +40,7 @@ instance Effect (Error e) where
|
||||
|
||||
throw :: Member (Error e) r => e -> Semantic r a
|
||||
throw = send . Throw
|
||||
{-# INLINE throw #-}
|
||||
|
||||
|
||||
catch
|
||||
@ -48,6 +49,7 @@ catch
|
||||
-> (e -> Semantic r a)
|
||||
-> Semantic r a
|
||||
catch try handle = send $ Catch try handle id
|
||||
{-# INLINE catch #-}
|
||||
|
||||
|
||||
runError :: Semantic (Error e ': r) a -> Semantic r (Either e a)
|
||||
|
Loading…
Reference in New Issue
Block a user