min in Interval?

21 views
Skip to first unread message

Siddhartha Gadgil

unread,
May 6, 2015, 6:37:51 AM5/6/15
to spire...@googlegroups.com
In the following code from GitHub, it appears that the parameter "min: A" in bottom in trait interval is there by accident. Is that correct (I pasted top as well for contrast)?

Thanks,
Siddhartha

def top(epsilon: A)(implicit r: AdditiveGroup[A]): Option[A] =
this match {
case Empty() | All() | Above(_, _) =>
None // TOCHECK: changed semantics, Empty().top == None
case Below(upper, uf) =>
Some(if (isOpenUpper(uf)) upper - epsilon else upper)
case Point(v) =>
Some(v)
case Bounded(_, upper, flags) =>
Some(if (isOpenUpper(flags)) upper - epsilon else upper)
}
def bottom(min: A, epsilon: A)(implicit r: AdditiveGroup[A]): Option[A] =
this match {
case Empty() | All() | Below(_, _) =>
None // TOCHECK: changed semantics, Empty().bottom == None
case Above(lower, lf) =>
Some(if (isOpenLower(lf)) lower + epsilon else lower)
case Point(v) =>
Some(v)
case Bounded(lower, _, flags) =>
Some(if (isOpenLower(flags)) lower + epsilon else lower)
}

Pablo Pita Leira

unread,
May 7, 2015, 10:10:21 AM5/7/15
to spire...@googlegroups.com
Hi Siddhartha,

This usage of this list is no longer encouraged. People should ask in the Typelevel list at: type...@googlegroups.com placing [spire] at the beginning of the subject.

Alec Zorab

unread,
May 7, 2015, 10:39:42 AM5/7/15
to Pablo Pita Leira, spire...@googlegroups.com
Since when? The github page still points to here.

Erik Osheim

unread,
May 7, 2015, 11:11:35 AM5/7/15
to Alec Zorab, Pablo Pita Leira, spire...@googlegroups.com
Hello,

Pablo is right, although as Alec notes I failed to update the
README. I'm currently happy to answer email on both lists -- I just
wanted to move traffic over to the Typelevel list in the long run.

In this case, I simply hadn't had time to reply.
Siddhartha, thanks for noticing this, and for your PR!

-- Erik

Pablo Pita Leira

unread,
May 7, 2015, 11:12:12 AM5/7/15
to spire...@googlegroups.com, pablo...@gmail.com
It was mentioned in this post.

I have created this pull request to fix the documentation.
Reply all
Reply to author
Forward
0 new messages