on master help sign in
Take out init for now.

Perhaps last should come out too.

commit8e69683235bb2398f3c2a078a737766ad634650b authorEvan Czaplicki <info@elm-lang.org> dateMon 28 Oct 2013, 11:29 (13 years ago) parentd8ced9e
2 files changed+1−21
libraries/List.elm+1−7 libraries/Native/List.js−14
libraries/List.elm+1−7
@@ -7,7 +7,7 @@ list must have the same type.
77@docs (::), (++), isEmpty, length, reverse, map
88
99# Sub-lists
10−@docs head, tail, last, init, filter, take, drop
10+@docs head, tail, last, filter, take, drop
1111
1212# Putting Lists Together
1313@docs concat, concatMap, join, intersperse, zip, zipWith
@@ -58,12 +58,6 @@ tail = Native.List.tail
5858last : [a] -> a
5959last = Native.List.last
6060
61−{-| Extract the elements before the last element in the list. List must be non-empty.
62−`(init [1,2,3] == [1,2])
63−-}
64−init : [a] -> [a]
65−init = Native.List.init
66−
6761{-| Check if a list is empty `(isEmpty [] == True)` -}
6862isEmpty : [a] -> Bool
6963isEmpty xs =
libraries/Native/List.js−14
@@ -81,19 +81,6 @@ Elm.Native.List.make = function(elm) {
8181 return out;
8282 }
8383
84− function init(xs) {
85− if (xs.ctor === '[]') { throwError('init'); }
86− var root = Cons(xs._0, Nil);
87− var curr = root;
88− xs = xs._1;
89− while (xs._1.ctor !== '[]') {
90− curr._1 = Cons(xs._0, Nil)
91− xs = xs._1
92− curr = curr._1
93− }
94− return root;
95− }
96−
9784 function map(f, xs) {
9885 var arr = [];
9986 while (xs.ctor !== '[]') {
@@ -291,7 +278,6 @@ Elm.Native.List.make = function(elm) {
291278 head:head,
292279 tail:tail,
293280 last:last,
294− init:init,
295281
296282 map:F2(map),
297283 foldl:F3(foldl),