Open pthariensflame opened 10 years ago
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.
I've started a discussion on Reddit.
http://www.reddit.com/r/haskell/comments/1whu8s/request_for_review_numbers/
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 partialCompare
function would cut it. I think a full PartialOrd
type class is absolutely necessary; I don't really care where it comes from, but I would rather use an existing one than add yet another copy to numbers
. If you can find a package other than logfloat
that implements a full PartialOrd
type class, I would be happy to take a look at it.
@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 PartialOrdering
class. It's obscure, and I don't think anybody will use it. (Do you have a use case for using this instance?)
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 encodeFloat
and decodeFloat
for Dif
. I think we should instead implement decodeFloat
in a way consistent with the rest of the code:
decodeFloat = decodeFloat . val
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 ispan
, but not ival'
.
I like the Eq
change, I think interval identity should be defined as equality of the endpoints of the interval, and anything else should be "not equal".
I don't like the current Ord
instance, but I think it should stay. It just needs to be documented.
@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 notifications@github.com 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 https://github.com/jwiegley/numbers/pull/10#issuecomment-270848643, 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 cartazio/numbers
repository I'll do the transfer!
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:
cartazio already has a repository in the jwiegley/numbers network
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
.Show
instance to always produce valid Haskell code.Read
instance in correspondence with the newShow
instance.Eq
instance so that it behaves mathematically sensibly.Ord
instance with an instance forPartialOrd
.logfloat
as a dependency to support this.PartialOrd
andcomparingPO
to make this easy to use.Bounded
instance.IntervalNesting
newtype
, supporting an alternativePartialOrd
instance around interval nesting.encodeFloat
anddecodeFloat
(such as they are) forDif
.