Skip to content

Add unsafeThrowException and unsafeThrow #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 13, 2015

Conversation

hdgarrood
Copy link
Contributor

For writing partial functions without having to resort to the FFI. For example, functions like Data.Maybe.Unsafe.fromJust

@paf31
Copy link
Contributor

paf31 commented Aug 28, 2015

👍

@hdgarrood
Copy link
Contributor Author

(nudge)

unsafeThrowException :: forall a. Error -> a
unsafeThrowException = unsafeRunEff <<< throwException
where
unsafeRunEff :: forall e b. Eff e b -> b
Copy link
Contributor

Choose a reason for hiding this comment

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

This could use the version in Control.Monad.Eff now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah good point - will do.

paf31 added a commit that referenced this pull request Nov 13, 2015
Add unsafeThrowException and unsafeThrow
@paf31 paf31 merged commit df294f6 into purescript:master Nov 13, 2015
@paf31
Copy link
Contributor

paf31 commented Nov 13, 2015

Thanks!

@hdgarrood hdgarrood deleted the unsafe-throw branch November 13, 2015 23:02
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