on master help sign in
Fix foldr1 bug (wrong base case). Reveal `isClickedOn` in Signal.Mouse. Bump version number.
commit03245c286a9964076f6c327044de7d1e6517881b authorevancz <info@elm-lang.org> dateThu 5 Jul 2012, 10:21 (14 years ago) parentc3ec869
5 files changed+23−19
core-js/List.js+14−11 core-js/cat.bat+1−1 core-js/runtime/Signal.js+4−3 elm/Elm.cabal+2−2 elm/src/Compiler.hs+2−2
core-js/List.js+14−11
@@ -127,17 +127,20 @@ var List = function() {
127127 }(_temp_50)
128128 }
129129 }
130− function foldr1(f_53) {
131− return function(_temp_54) {
132− return function(v) {
133− if("Cons" !== v[0]) {
134− return undefined
135− }else {
136− var x_55 = v[1];
137− var xs_56 = v[2];
138− return foldr(f_53)(x_55)(xs_56)
139− }
140− }(_temp_54)
130+ function foldr1(f) {
131+ return function(xs) {
132+ if (xs[0] === "Nil") { throw "'foldr1' requires an non-empty list." }
133+ if (xs[0] !== "Cons") { throwError('foldr1'); }
134+ var arr = [];
135+ while (xs[0] === "Cons") {
136+ arr.push(xs[1]);
137+ xs = xs[2];
138+ }
139+ var acc = arr.pop();
140+ for (var i = arr.length; i--; ) {
141+ acc = f(arr[i])(acc);
142+ }
143+ return acc;
141144 }
142145 }
143146 function scanl(f) {
core-js/cat.bat+1−1
@@ -2,6 +2,6 @@ copy /B Guid.js+foreign\JavaScript.js+Value.js+List.js+Data.js+collage\Color.js+
22
33cd ..\elm
44
5−copy /B ..\elm-mini.js elm-runtime-0.3.5.js
5+copy /B ..\elm-mini.js elm-runtime-0.3.5.1.js
66
77cabal install
core-js/runtime/Signal.js+4−3
@@ -66,8 +66,8 @@ var Signal = function() {
6666 y: Elm.Lift(function(p){return p[2];},[position]),
6767 isClicked: isClicked,
6868 isDown: isDown,
69− clicks: clicks
70− //clickedOn: clickedOn
69+ clicks: clicks,
70+ isClickedOn: clickedOn
7171 };
7272 }();
7373
@@ -193,7 +193,8 @@ var Signal = function() {
193193 };
194194 };
195195 return {get : fetch("GET"), post : fetch("POST"),
196− gets : fetches("GET"), posts : fetches("POST") };
196+ gets : fetches("GET"), posts : fetches("POST")
197+ };
197198 }();
198199 var Random = function() {
199200 var inRange = function(min) { return function(max) {
elm/Elm.cabal+2−2
@@ -1,6 +1,6 @@
11
22Name: Elm
3−Version: 0.3.5
3+Version: 0.3.5.1
44Synopsis: The Elm language module.
55Description: Elm aims to make client-side web-development more pleasant.
66 It is a statically/strongly typed, functional reactive
@@ -22,7 +22,7 @@ Category: Compiler, Language
2222Build-type: Simple
2323
2424Extra-source-files: changelog.txt
25−Data-files: elm-runtime-0.3.5.js
25+Data-files: elm-runtime-0.3.5.1.js
2626Cabal-version: >=1.8
2727
2828source-repository head
elm/src/Compiler.hs+2−2
@@ -35,11 +35,11 @@ elm = ELM { make = False &= help "automatically compile dependencies."
3535 , generate_noscript = False &= help "Add generated <noscript> tag to HTML output."
3636 } &=
3737 help "Compile Elm programs to HTML, CSS, and JavaScript." &=
38− summary "The Elm Compiler v0.3.5, (c) Evan Czaplicki"
38+ summary "The Elm Compiler v0.3.5.1, (c) Evan Czaplicki"
3939
4040main = do
4141 args <- cmdArgs elm
42− mini <- getDataFileName "elm-runtime-0.3.5.js"
42+ mini <- getDataFileName "elm-runtime-0.3.5.1.js"
4343 compileArgs mini args
4444
4545compileArgs mini (ELM _ [] _ _ _ _ _) =