UNPKG

elm-basic-compile

Version:

elm-compiler built with GHCJS and wrapped in a simple interface

177 lines (175 loc) 4.74 kB
module.exports.prelude = [ "(function() {", "'use strict';", "function F2(fun)", "{", "function wrapper(a) { return function(b) { return fun(a,b); }; }", "wrapper.arity = 2;", "wrapper.func = fun;", "return wrapper;", "}", "", "function F3(fun)", "{", "function wrapper(a) {", "return function(b) { return function(c) { return fun(a, b, c); }; };", "}", "wrapper.arity = 3;", "wrapper.func = fun;", "return wrapper;", "}", "", "function F4(fun)", "{", "function wrapper(a) { return function(b) { return function(c) {", "return function(d) { return fun(a, b, c, d); }; }; };", "}", "wrapper.arity = 4;", "wrapper.func = fun;", "return wrapper;", "}", "", "function F5(fun)", "{", "function wrapper(a) { return function(b) { return function(c) {", "return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; };", "}", "wrapper.arity = 5;", "wrapper.func = fun;", "return wrapper;", "}", "", "function F6(fun)", "{", "function wrapper(a) { return function(b) { return function(c) {", "return function(d) { return function(e) { return function(f) {", "return fun(a, b, c, d, e, f); }; }; }; }; };", "}", "wrapper.arity = 6;", "wrapper.func = fun;", "return wrapper;", "}", "", "function F7(fun)", "{", "function wrapper(a) { return function(b) { return function(c) {", "return function(d) { return function(e) { return function(f) {", "return function(g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; };", "}", "wrapper.arity = 7;", "wrapper.func = fun;", "return wrapper;", "}", "", "function F8(fun)", "{", "function wrapper(a) { return function(b) { return function(c) {", "return function(d) { return function(e) { return function(f) {", "return function(g) { return function(h) {", "return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; };", "}", "wrapper.arity = 8;", "wrapper.func = fun;", "return wrapper;", "}", "function F9(fun)", "{", "function wrapper(a) { return function(b) { return function(c) {", "return function(d) { return function(e) { return function(f) {", "return function(g) { return function(h) { return function(i) {", "return fun(a, b, c, d, e, f, g, h, i); }; }; }; }; }; }; }; };", "}", "wrapper.arity = 9;", "wrapper.func = fun;", "return wrapper;", "}", "", "function A2(fun, a, b)", "{", "return fun.arity === 2", "? fun.func(a, b)", ": fun(a)(b);", "}", "function A3(fun, a, b, c)", "{", "return fun.arity === 3", "? fun.func(a, b, c)", ": fun(a)(b)(c);", "}", "function A4(fun, a, b, c, d)", "{", "return fun.arity === 4", "? fun.func(a, b, c, d)", ": fun(a)(b)(c)(d);", "}", "function A5(fun, a, b, c, d, e)", "{", "return fun.arity === 5", "? fun.func(a, b, c, d, e)", ": fun(a)(b)(c)(d)(e);", "}", "function A6(fun, a, b, c, d, e, f)", "{", "return fun.arity === 6", "? fun.func(a, b, c, d, e, f)", ": fun(a)(b)(c)(d)(e)(f);", "}", "function A7(fun, a, b, c, d, e, f, g)", "{", "return fun.arity === 7", "? fun.func(a, b, c, d, e, f, g)", ": fun(a)(b)(c)(d)(e)(f)(g);", "}", "function A8(fun, a, b, c, d, e, f, g, h)", "{", "return fun.arity === 8", "? fun.func(a, b, c, d, e, f, g, h)", ": fun(a)(b)(c)(d)(e)(f)(g)(h);", "}", "function A9(fun, a, b, c, d, e, f, g, h, i)", "{", "return fun.arity === 9", "? fun.func(a, b, c, d, e, f, g, h, i)", ": fun(a)(b)(c)(d)(e)(f)(g)(h)(i);", "}" ]; module.exports.footer = function(packageSpec) { var pname = '_' + packageSpec.user + '$' + packageSpec.project; return [ "var Elm = {};", "Elm['Main'] = Elm['Main'] || {};", "if (typeof "+pname+"$Main$main !== 'undefined') {", " "+pname+"$Main$main(Elm['Main'], 'Main', undefined);", "}", "", "if (typeof define === \"function\" && define['amd'])", "{", " define([], function() { return Elm; });", " return;", "}", "", "if (typeof module === \"object\")", "{", " module['exports'] = Elm;", " return;", "}", "", "var globalElm = this['Elm'];", "if (typeof globalElm === \"undefined\")", "{", " this['Elm'] = Elm;", " return;", "}", "", "for (var publicModule in Elm)", "{", " if (publicModule in globalElm)", " {", " throw new Error('There are two Elm modules called `' + publicModule + '` on this page! Rename one of them.');", " }", " globalElm[publicModule] = Elm[publicModule];", "}", "", "}).call(this);" ]; }