Skip to content

yesod-test SIO MonadFail#1874

Merged
jezen merged 2 commits intoyesodweb:masterfrom
L0neGamer:sio-monadfail
Jun 6, 2025
Merged

yesod-test SIO MonadFail#1874
jezen merged 2 commits intoyesodweb:masterfrom
L0neGamer:sio-monadfail

Conversation

@L0neGamer
Copy link
Copy Markdown
Contributor

@L0neGamer L0neGamer commented Jun 4, 2025

Before submitting your PR, check that you've:

After submitting your PR:

  • Update the Changelog.md file with a link to your PR
  • Check that CI passes (or if it fails, for reasons unrelated to your change, like CI timeouts)

L0neGamer added 2 commits June 5, 2025 09:17
defining `fail = error` for SIO, with a `HasCallStack` so that when we fail to
match in a do block we immediately alert the caller and have a callstack.

this is fine to do in testing since this can be a form of test in and of itself

example:
```
test = do
  [oneElem] <- getListOfThings
  -- ^ if this doesn't return exactly one element, we'll fail out
  doWithOneElem oneElem
```
Copy link
Copy Markdown
Member

@jezen jezen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sensible. Thanks for the clear commit message!

@jezen jezen merged commit b11d4ae into yesodweb:master Jun 6, 2025
13 checks passed
@L0neGamer L0neGamer deleted the sio-monadfail branch June 6, 2025 10:55
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