-
Notifications
You must be signed in to change notification settings - Fork 13
Miscellaneous improvements #10
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
base: master
Are you sure you want to change the base?
Conversation
- made the constructor `I` strict for better performance - added `ival'` and `ispan` - corrected `Show` instance to always produce valid Haskell code - added valid `Read` instance in correspondence with the new `Show` instance - added `Bounded` instance
such as they are, anyway
Thanks, Travis.
Whew!
Especially when currying is involved
Hopefully that's it!
|
Thanks for the pull request! I'm going to put my critical cap on, challenge a few of these design decisions, and ask some more people to review these changes. |
Data/Number/Interval.hs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this strictness is justified. Theoretically there might be lazy numeric types that we might want to use this with. And anyways, if the user is invoking ival or ival' to construct an Interval, then the code will perform <=, which in most cases will force the numbers at that point so they can be compared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can appreciate that you might want to support lazy types, but in that case all the other types in the library should be changed to reflect that. I just noted that everything except Interval is currently strict, and assumed that you wanted strictness to be the default. If that assumption was wrong, I can change all the other types instead. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really have an opinion one way or the other; I just want to make sure I don't screw up numbers for anybody who might be using it. Lazifying the rest of the library might be the right way to go. Let's try and connect with a few other numbers users and see what they think. I just noticed in this particular case that there doesn't seem to be any benefit to making these fields strict other than source code consistency.
|
I've started a discussion on Reddit. http://www.reddit.com/r/haskell/comments/1whu8s/request_for_review_numbers/ |
In preperation for rewriting the `Ord` instance of `Interval`
Also makes the `Eq` instance behave somewhat more sensibly. Additionally, this removes the internal strictness of `Interval`.
This allows an alternative `PartialOrd` instance to exist. Also re-exports `PartialOrd` and `comparingPO` from this module.
Where did you go, `where`?
|
i'd advocate log-domain rather than log-float if you really wanted to add log domain floats. (which i don't really see being used, its just picked up because it has a partial-ord class, which i'd be inclined to be against. Unless you're saying its the canonical choice of hypothetical partial ord class) likewise, i'm not sure if you gain much by adding a partialOrd type class, a simple partialCompare function for intervals would be just fine! removing the "slightly illegal" instances, like Ord, while "valid", we have to accept that base has "slightly illegal" instances too, |
|
in case its not clear, I really don't like log-float, i like log-domain is a better lib :) |
|
just to be clear: i do favor improving numbers, but if we're going to deal with illegal instances, we should work on a whole new number prelude! Working around the flaws in the stand number prelude in a localized way just won't buy you that much. |
|
I don't think just a |
|
@cartazio, regarding "we should work on a whole new number prelude!", that's been done numerous times (pun intended), and I don't think that's really what this library is for. As I understand it, the main purpose for this library is for use with lambdabot, to facilitate quick-n-dirty numeric stuff on top of the functionality Prelude provides. It may be true that "working around the flaws in the stand number prelude in a localized way just won't buy you that much," but that's pretty much what this library does, and I'm not inclined to radically alter it. |
|
@DanBurton agreed :) |
|
@pthariensflame upon reflection, I don't like adding a dependency and pulling in the So I'm inclined to mostly reject this pull request. There are, however, a couple things I'd like to bring in: I like adding It gives an answer of questionable meaningfulness for derivitives, but this is no different from a lot of those other instance methods. I like the show/read changes. I like I like the I don't like the current |
|
@DanBurton Alright; feel free to just copy what you want from this and leave the reas. :) |
|
I'm transferring ownership of the repository to to @jwiegley, so I'll just leave this PR open and let him decide how to handle it. |
|
I've been too far removed from this project for too long, and I'm ready to give this up to the next maintainer, who can make a decision on this issue. @cartazio Are you up for that? Or @DanBurton do you want to take it back? I didn't end up using it as much as I had intended, and now my focus is elsewhere, and not on Haskell numerics. |
|
Happy to help.
I've had some slow motion collabs in the math spheres. I will admit I've
not been in the loop on the numbers package activity lately but can start
taking an active poke at it mid / late Jan or early feb. have enough on the
queue for next few weeks
…On Fri, Jan 6, 2017 at 2:35 AM John Wiegley ***@***.***> wrote:
I've been too far removed from this project for too long, and I'm ready to
give this up to the next maintainer, who can make a decision on this issue.
@cartazio <https://github.com/cartazio> Are you up for that? Or @DanBurton
<https://github.com/DanBurton> do you want to take it back? I didn't end
up using it as much as I had intended, and now my focus is elsewhere, and
not on Haskell numerics.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAQwtGgRzOPN9-9c8Zk9ZslcOjIUwvgks5rPe7bgaJpZM4BdYVK>
.
|
|
Is there anyone who would like to maintain this package, and to have this GitHub repository transferred over to them? |
|
i thought i had done a bunch a few years ago, let me double check if i have that branch somewhere just in case i didn't release it |
|
yup, looks like I had a bunch started, happy to take over or if theres someone who's keen to do a more energetic maintainership, that'd be great too |
|
@cartazio Great, if you can drop your |
|
i'm a little headless chicken the next few days, i'll make sure i have a calendar reminder to do it this weekend :) |
|
I'll email/message you or this thread in the next week or so once i've done that, juggling some personal matters this month |
|
@cartazio OK, just to add a little fire, I will close this PR next month if no further activity occurs. :) Trying to get my account to PR inbox zero. |
|
rename done :) |
|
Thanks! But GitHub is saying:
|
|
oh, i'll fix that |
|
fixed! |
|
@cartazio You should have the invite to transfer now... |
|
reviewing this PR now, sorry for the terrible latency |
Interval:ival'andispan.Showinstance to always produce valid Haskell code.Readinstance in correspondence with the newShowinstance.Eqinstance so that it behaves mathematically sensibly.Ordinstance with an instance forPartialOrd.logfloatas a dependency to support this.PartialOrdandcomparingPOto make this easy to use.Boundedinstance.IntervalNestingnewtype, supporting an alternativePartialOrdinstance around interval nesting.encodeFloatanddecodeFloat(such as they are) forDif.