diff --git a/src/CustomArray.elm b/src/CustomArray.elm index 449a646..97c577e 100644 --- a/src/CustomArray.elm +++ b/src/CustomArray.elm @@ -26,8 +26,7 @@ module CustomArray import Bitwise ---import Table exposing (Table) -import NaiveTable as Table exposing (Table) +import Table exposing (Table) import Assume exposing (assumeJust) import ListUtils import TupleUtils diff --git a/src/Native/Table.js b/src/Native/Table.js index bc9c235..b8db2e3 100644 --- a/src/Native/Table.js +++ b/src/Native/Table.js @@ -1,6 +1,5 @@ Elm.Native.Table = {}; Elm.Native.Table.make = function(localRuntime) { - localRuntime.Native = localRuntime.Native || {}; localRuntime.Native.Table = localRuntime.Native.Table || {}; if (localRuntime.Native.Table.values) @@ -93,6 +92,10 @@ Elm.Native.Table.make = function(localRuntime) { function initialize(f, len) { + if (len <= 0) { + return []; + } + var result = new Array(len); for (var i = 0; i < len; ++i) @@ -162,7 +165,7 @@ Elm.Native.Table.make = function(localRuntime) { // TODO: This can definitely be rewritten in terms of initialize function append(table1, table2) { - return table.concat(table2); + return table1.concat(table2); } function get(i, table) @@ -358,7 +361,7 @@ Elm.Native.Table.make = function(localRuntime) { length: length, - map: map, + map: F2(map), foldl: F3(foldl), foldr: F3(foldr), mapAccumL: F3(mapAccumL),