Could not find implicit value for parameter ordering?

This compiles and it exhibits two variants, one using Ordered keys ( K ) and the other using an Ordering on the keys: package disttree { import scala.collection.immutable. TreeMap import scala.math. {Ordered, Ordering} // class BtreeK Compare(k1, k2) } abstract class Node extends TreeMapK,V class InnerNode extends Node class LeafNode extends Node val root = new InnerNode() def search(n: Node, key: K): Option(K,V) = { return n.

Find(_ == key) } def insert(key: K, value: V) { } def delete(key: K) { } } } import disttree. _; object Tester { def main(args: ListString) = { var t = new BtreeInt, Any(2) t. Insert(1, "goodbye") Console.

Println(t) } }.

This compiles and it exhibits two variants, one using Ordered keys (K) and the other using an Ordering on the keys: package disttree { import scala.collection.immutable. TreeMap import scala.math. {Ordered, Ordering} // class BtreeK Compare(k1, k2) } abstract class Node extends TreeMapK,V class InnerNode extends Node class LeafNode extends Node val root = new InnerNode() def search(n: Node, key: K): Option(K,V) = { return n.

Find(_ == key) } def insert(key: K, value: V) { } def delete(key: K) { } } } import disttree. _; object Tester { def main(args: ListString) = { var t = new BtreeInt, Any(2) t. Insert(1, "goodbye") Console.

Println(t) } }.

Common mistake. These are two different K's: class BtreeK :13: error: type mismatch; found : Btree#31335.this. DefaultOrder#31343.

Type (with underlying type object Btree#31335.this. DefaultOrder#31344) required: Ordering#3222K#31346 abstract class NodeK,V extends TreeMapK,V()(DefaultOrder) ^ Btree#31335.this. DefaultOrder#31343.

Type Ordering#11986K#31346? Scala.math. Ordering#11986K#31336 Ordering#11986K#31346?

K#31346.

And if I'm not mistaking it tries to find some OrderingT (according to implicit definition in companion object) that can be used as last resort (but it fails). So if you will define type parameter T like T If you find flaws in my logic - please comment!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions