Commit e4b5271a authored by Jim Newton's avatar Jim Newton

removed A <% Ordered[A], replaced with implicit variable

parent 763754b7
......@@ -68,11 +68,11 @@ object Accumulators {
acc
}
def withMaximizer[A <% Ordered[A]](init: A)(f: (A => Unit) => Unit): A = {
def withMaximizer[A](init: A)(f: (A => Unit) => Unit)(implicit ev: A => Ordered[A]): A = {
withReducer(init, (a:A,b:A)=>if (a < b) b else a)(f)
}
def withMinimizer[A <% Ordered[A]](init: A)(f: (A => Unit) => Unit): A = {
def withMinimizer[A](init: A)(f: (A => Unit) => Unit)(implicit ev: A => Ordered[A]): A = {
withReducer(init, (a:A,b:A)=>if (a > b) b else a)(f)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment