Skip to content

Commit

Permalink
Tidy EarlyReturn
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjaguarpaw committed Jan 29, 2024
1 parent a6d5687 commit 450ffeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bluefin-internal/src/Bluefin/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,17 @@ handleException' h f = do
type EarlyReturn = Exception

withEarlyReturn ::
(forall ex. EarlyReturn r ex -> Eff (ex :& effs) r) ->
(forall er. EarlyReturn r er -> Eff (er :& effs) r) ->
-- | ͘
Eff effs r
withEarlyReturn = handleException' id

earlyReturn :: (ex :> effs) => EarlyReturn r ex -> r -> Eff effs a
earlyReturn ::
(er :> effs) =>
EarlyReturn r er ->
r ->
-- | ͘
Eff effs a
earlyReturn = throw

evalState ::
Expand Down
1 change: 1 addition & 0 deletions bluefin/src/Bluefin/EarlyReturn.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Bluefin.EarlyReturn
( EarlyReturn,
withEarlyReturn,
earlyReturn,
)
where
Expand Down

0 comments on commit 450ffeb

Please sign in to comment.