Skip to content
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 64 commits into from
Nov 19, 2017
Merged

big update fixing many things #27

merged 64 commits into from
Nov 19, 2017

Conversation

claudeha
Copy link
Collaborator

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.

claudeha added 30 commits June 6, 2015 18:21
* 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
@copumpkin
Copy link
Collaborator

Awesome!

@cartazio
Copy link

ZOMG yay

@claudeha claudeha deleted the claude branch November 27, 2017 20:48
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.

4 participants