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

Don't use Integer in bindings #6

Closed
vmchale opened this issue Nov 24, 2018 · 2 comments
Closed

Don't use Integer in bindings #6

vmchale opened this issue Nov 24, 2018 · 2 comments

Comments

@vmchale
Copy link
Contributor

vmchale commented Nov 24, 2018

Is there any reason the Integer type is used? I'd like type signatures downstream to use Ints instead of Integers. Or really anything efficient (I assume ALSA doesn't bind GMP?)

@ttuegel
Copy link
Owner

ttuegel commented Nov 28, 2018

The ALSA API uses the C int type (Haskell CInt type), which has a wider range than Int. GHC represents small Integer values as Int without using GMP, so I would be surprised if this was a bottleneck. Still, I agree it would be ideal if the Haskell interface used a type with the same representation as the C API; would it be awkward if the Haskell interface used CInt?

@vmchale
Copy link
Contributor Author

vmchale commented Nov 28, 2018

I'd be satisfied with CInt, yes. I think Int is probably the same thing barring some odd platform, but it is easy to convert either way.

@ttuegel ttuegel closed this as completed in 5cd1972 Dec 9, 2018
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

No branches or pull requests

2 participants