-
Notifications
You must be signed in to change notification settings - Fork 13
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
big update fixing many things #27
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* data Rounded is now like data MPFR but with the limbs in a ByteArray# instead of a Ptr * internally, FFI uses allocaBytes to allocate limb data and copies to/from ByteArray#, which should be safe as long as the foreign call doesn't try to reallocate it with MPFR/GMP memory functions * marshalling routines check that the precision matches what is expected, returning a Maybe -- the internal FFI usage will crash with a pattern match failure if this happens * exposed FFI helpers use mpfr_init2 and mpfr_clear to allocate output limbs, instead of allocaBytes; source limbs are still using allocaBytes, which should be safe if the client code doesn't use it as anything other than a source pointer. * expose mixed-precision versions of most functions * still need: something along the lines of peekMPFR :: Ptr MPFR -> (forall p . Precision p => Rounded r p -> IO a) -> IO a
* rename withRounded to withInRounded * swap result tuple of withOutRounded to match hgmp convention * simpl withInOutRounded implementation
…flow where appropriate
This was referenced Nov 20, 2017
Closed
Closed
Awesome! |
ZOMG yay |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A large set of changes from 2015 and this week. It should work with GHC 7.10.1 or later. The old CMM prim bindings and patched MPFR are gone, now using regular FFI and system MPFR. I haven't run extensive tests, but fiddling around in GHCI has been fine, no crashes or unexpected output.
This PR should fix tickets #7 #12 #13 #14 #18 #19 #21 #22 #23 #24 #26 .
I'm currently seeking help from GHC users mailing list for ticket #9 (RULES pragmas). Ticket #15 is a general wish-list item. Ticket #17 I don't know which behaviour is correct. No other open tickets.