From 58dcce494591a2d57fa6b19c5fe68112a1ed8d3d Mon Sep 17 00:00:00 2001 From: Manos Koukoutos <emmanouil.koukoutos@epfl.ch> Date: Tue, 25 Aug 2015 15:03:19 +0200 Subject: [PATCH] List.length as an alias to size --- library/collection/List.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/collection/List.scala b/library/collection/List.scala index b739aa3bb..399ef5b83 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 -- GitLab