Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
Make protect safer against exceptions in a Pipe value.
Browse files Browse the repository at this point in the history
Restore commit 7bb846e, it went lost
during refactoring.
  • Loading branch information
pcapriotti committed Jul 8, 2012
1 parent 0152395 commit fc467df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Control/Pipe/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ finallyP p w = go p
go (Await k j h w') = Await (go . k) (go . j) (go . h) (w ++ w')

protectP :: Monad m => Finalizer m -> Pipe m a b u r -> Pipe m a b u r
protectP w = go
protectP w p = M Masked (return $! go p) (`Throw` w)
where
go (Pure r w') = Pure r (w ++ w')
go (Await k h j w') = Await k h j w'
Expand Down

0 comments on commit fc467df

Please sign in to comment.