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

Export ArithK #2

Closed
wants to merge 5 commits into from
Closed

Export ArithK #2

wants to merge 5 commits into from

Conversation

LightAndLight
Copy link

I've been fooling around with this packing and found that it's been helpful to have access to ArithK.

@adituv
Copy link
Owner

adituv commented Jul 31, 2018

Thanks for the PR! All the changes look good, but I'm wondering: what use-case do you have for ArithK to be exposed? I don't particularly want to expose it as is without making a few changes first because it is a bit of a messy and potentially misleading implementation detail.

@LightAndLight
Copy link
Author

Here's the code I've written that uses it

https://github.com/LightAndLight/ranged/blob/master/src/Data/Ranged.hs#L25

@adituv
Copy link
Owner

adituv commented Aug 1, 2018

I see, that does make sense! If it's ok with you, I'll move it to an exposed internal module and document it further rather than just export it as is.

Also, would open type families be useful for you, so you could just add new cases to the existing operators?

Edit: it seems like open type families don't work with GHC < 8.2. I need to look into this some more still.

adituv added a commit that referenced this pull request Aug 1, 2018
* Move current Arithmetic module to Arithmetic.Internal
* Rename type families to Add/Mul, etc
* Make all type families open
* New Arithmetic module that just re-exports polykinded infix synonyms
  for the type families
adituv added a commit that referenced this pull request Aug 1, 2018
* Move current Arithmetic module to Arithmetic.Internal
* Rename type families to Add/Mul, etc
* Make all type families open
* New Arithmetic module that just re-exports polykinded infix synonyms
  for the type families

Closes #2
@LightAndLight
Copy link
Author

Awesome, thanks :)

@adituv adituv added the enhancement New feature or request label Aug 1, 2018
adituv added a commit that referenced this pull request Aug 2, 2018
* Move current Arithmetic module to Arithmetic.Internal
* Rename type families to Add/Mul, etc
* Make all type families open for GHC >= 8.2
* New Arithmetic module that just re-exports polykinded infix synonyms
  for the type families

Closes #2
@adituv
Copy link
Owner

adituv commented Aug 2, 2018

Unfortunately I can't get extending open type families to work at present, so I'm just going to push through the smaller fix to expose the kind families for you and leave that as a future improvement in #3.

adituv added a commit that referenced this pull request Aug 2, 2018
* Move current Arithmetic module to Arithmetic.Internal
* Rename type families to Add/Mul, etc
* New Arithmetic module that just re-exports polykinded infix synonyms
  for the type families

NB. GHC 8.0.1 bug causes tests to fail to compile on -O1 or -O2

Closes #2
@adituv adituv closed this in 5d91583 Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants