diff --git a/library/collection/List.scala b/library/collection/List.scala index b739aa3bb32c40e1912bfaddc55c7917d97426d1..399ef5b83332196f4d006db16668ad4fd2686fae 100644 --- a/library/collection/List.scala +++ b/library/collection/List.scala @@ -16,6 +16,8 @@ sealed abstract class List[T] { case Cons(h, t) => 1 + t.size }) ensuring (_ >= 0) + def length = size + def content: Set[T] = this match { case Nil() => Set() case Cons(h, t) => Set(h) ++ t.content