2Elm.Native.Basics = function(elm) {
4 if (elm.Native.Basics) return elm.Native.Basics;
6 var JS = Elm.JavaScript(elm);
7 var Maybe = Elm.Maybe(elm);
8 var Utils = Elm.Native.Utils(elm);
9 var Char = Elm.Char(elm);
11 function div(a,b) { return (a/b)|0; }
12 function rem(a,b) { return a % b; }
14 function abs(x) { return x < 0 ? -x : x; }
15 function logBase(base,n) { return Math.log(n) / Math.log(base); }
16 function min(a,b) { return Utils.cmp(a,b) < 0 ? a : b; }
17 function max(a,b) { return Utils.cmp(a,b) > 0 ? a : b; }
18 function clamp(lo,hi,n) {
19 return Utils.cmp(n,lo) < 0 ? lo : Utils.cmp(n,hi) > 0 ? hi : n; }
20 function xor(a,b) { return a !== b; }
21 function not(b) { return !b; }
23 function truncate(n) { return n|0; }
25 function curry(f,a,b) { return f(Utils.Tuple2(a,b)); }
26 function uncurry(f,v) { return A2(f,v._0,v._1); }
27 function fst(t) { return t._0; }
28 function snd(t) { return t._1; }
30 function readInt(str) {
31 var s = JS.fromString(str);
33 if (len === 0) { return Maybe.Nothing; }
36 if (len === 1) { return Maybe.Nothing; }
39 for (var i = start; i < len; ++i) {
40 if (!Char.isDigit(s[i])) { return Maybe.Nothing; }
42 return Maybe.Just(parseInt(s, 10));
45 function readFloat(str) {
46 var s = JS.fromString(str);
48 if (len === 0) { return Maybe.Nothing; }
51 if (len === 1) { return Maybe.Nothing; }
55 for (var i = start; i < len; ++i) {
56 if (Char.isDigit(s[i])) { continue; }
59 if (dotCount <= 1) { continue; }
63 return Maybe.Just(parseFloat(s));
87 compare:Utils.compare,
96 toFloat:function(x) { return x; },
107 return elm.Native.Basics = basics;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list