@@ -4,6 +4,9 @@ import scala.language.future
44trait Ord [X ]:
55 def compare (x : X , y : X ): Int
66
7+ trait Show [X ]:
8+ def show (x : X ): String
9+
710val less1 = [X : Ord ] => (x : X , y : X ) => summon[Ord [X ]].compare(x, y) < 0
811
912val less2 = [X : Ord as ord ] => (x : X , y : X ) => ord.compare(x, y) < 0
@@ -17,4 +20,12 @@ val less3: Comparer = [X: Ord as ord] => (x: X, y: X) => ord.compare(x, y) < 0
1720// type Comparer2 = [X: Ord] => Cmp[X]
1821// val less4: Comparer2 = [X: Ord] => (x: X, y: X) => summon[Ord[X]].compare(x, y) < 0
1922
20- val less5 = [X : [X ] =>> Ord [X ]] => (x : X , y : X ) => summon[Ord [X ]].compare(x, y) < 0
23+ val less5 = [X : [X ] =>> Ord [X ]] => (x : X , y : X ) => summon[Ord [X ]].compare(x, y) < 0
24+
25+ val less6 = [X : {Ord , Show }] => (x : X , y : X ) => summon[Ord [X ]].compare(x, y) < 0
26+
27+ val less7 = [X : {Ord as ord , Show }] => (x : X , y : X ) => ord.compare(x, y) < 0
28+
29+ val less8 = [X : {Ord , Show as show }] => (x : X , y : X ) => summon[Ord [X ]].compare(x, y) < 0
30+
31+ val less9 = [X : {Ord as ord , Show as show }] => (x : X , y : X ) => ord.compare(x, y) < 0
0 commit comments