content: {-# LANGUAGE OverloadedStrings #-}
  {-# LANGUAGE QuasiQuotes #-}
  
  module Generate.JavaScript.Functions
    ( functions,
    )
  where
  
  import Data.ByteString.Builder qualified as B
  import Text.RawString.QQ (r)
  
  -- FUNCTIONS
  
  functions :: B.Builder
  functions =
    [r|
  
  /* @__NO_SIDE_EFFECTS__ */
  function F2(fun) {
    var wrapper = function(a) { return function(b) { return fun(a,b); }; };
    wrapper.a2 = fun;
    return wrapper;
  }
  /* @__NO_SIDE_EFFECTS__ */
  function F3(fun) {
    var wrapper = function(a) {
      return function(b) { return function(c) { return fun(a, b, c); }; };
    };
    wrapper.a3 = fun;
    return wrapper;
  }
  /* @__NO_SIDE_EFFECTS__ */
  function F4(fun) {
    var wrapper = function(a) { return function(b) { return function(c) {
      return function(d) { return fun(a, b, c, d); }; }; };
    };
    wrapper.a4 = fun;
    return wrapper;
  }
  /* @__NO_SIDE_EFFECTS__ */
  function F5(fun) {
    var wrapper = function(a) { return function(b) { return function(c) {
      return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; };
    };
    wrapper.a5 = fun;
    return wrapper;
  }
  /* @__NO_SIDE_EFFECTS__ */
  function F6(fun) {
    var wrapper = function(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.a6 = fun;
    return wrapper;
  }
  /* @__NO_SIDE_EFFECTS__ */
  function F7(fun) {
    var wrapper = function(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.a7 = fun;
    return wrapper;
  }
  /* @__NO_SIDE_EFFECTS__ */
  function F8(fun) {
    var wrapper = function(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.a8 = fun;
    return wrapper;
  }
  /* @__NO_SIDE_EFFECTS__ */
  function F9(fun) {
    var wrapper = function(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.a9 = fun;
    return wrapper;
  }
  
  /* @__NO_SIDE_EFFECTS__ */
  function A2(fun, a, b) {
    return fun.a2 ? fun.a2(a, b) : fun(a)(b);
  }
  /* @__NO_SIDE_EFFECTS__ */
  function A3(fun, a, b, c) {
    return fun.a3 ? fun.a3(a, b, c) : fun(a)(b)(c);
  }
  /* @__NO_SIDE_EFFECTS__ */
  function A4(fun, a, b, c, d) {
    return fun.a4 ? fun.a4(a, b, c, d) : fun(a)(b)(c)(d);
  }
  /* @__NO_SIDE_EFFECTS__ */
  function A5(fun, a, b, c, d, e) {
    return fun.a5 ? fun.a5(a, b, c, d, e) : fun(a)(b)(c)(d)(e);
  }
  /* @__NO_SIDE_EFFECTS__ */
  function A6(fun, a, b, c, d, e, f) {
    return fun.a6 ? fun.a6(a, b, c, d, e, f) : fun(a)(b)(c)(d)(e)(f);
  }
  /* @__NO_SIDE_EFFECTS__ */
  function A7(fun, a, b, c, d, e, f, g) {
    return fun.a7 ? fun.a7(a, b, c, d, e, f, g) : fun(a)(b)(c)(d)(e)(f)(g);
  }
  /* @__NO_SIDE_EFFECTS__ */
  function A8(fun, a, b, c, d, e, f, g, h) {
    return fun.a8 ? fun.a8(a, b, c, d, e, f, g, h) : fun(a)(b)(c)(d)(e)(f)(g)(h);
  }
  /* @__NO_SIDE_EFFECTS__ */
  function A9(fun, a, b, c, d, e, f, g, h, i) {
    return fun.a9 ? fun.a9(a, b, c, d, e, f, g, h, i) : fun(a)(b)(c)(d)(e)(f)(g)(h)(i);
  }
  
  |]
  