Skip to content

Add support for exception handling - #141

Merged
chrisdone-artificial merged 4 commits into
chrisdone:mainfrom
fpringle:exception-handling
Oct 2, 2026
Merged

chrisdone-artificial merged 4 commits into
chrisdone:mainfrom
fpringle:exception-handling

Conversation

@fpringle

@fpringle fpringle commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

See discussion here.

Adds the following functions from Control.Exception:

Exception.finally :: forall a b. IO a -> IO b -> IO a
Exception.onException :: forall a b. IO a -> IO b -> IO a
Exception.bracket :: forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
SomeException.catch :: forall a. IO a -> (SomeException -> IO a) -> IO a

Note that SomeException.catch is specific to SomeException. In the future a more general Exception.catch :: forall e a. IO a -> (e -> IO a) -> IO a could be added.

Examples are in examples/46-exceptions.hell and docs have been updated.

@fpringle
fpringle marked this pull request as ready for review October 2, 2026 14:33
@chrisdone-artificial

Copy link
Copy Markdown
Collaborator

Nice, thank you! I usually only update docs when I cut a release. But this is fine, I can cut a release anyway. 👌

@chrisdone-artificial
chrisdone-artificial merged commit 25c2cc4 into chrisdone:main Oct 2, 2026
@chrisdone-artificial

Copy link
Copy Markdown
Collaborator

Pushed a release Release 2026-10-02 · chrisdone/hell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants